Documentation of 'jsat.datatransform.kernel.RFF_RBF' Java class
RFF_RBF
jsat.datatransform.kernel

Class RFF_RBF

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, DataTransform, Parameterized


    public class RFF_RBF
    extends DataTransformBase
    An Implementation of Random Fourier Features for the RBFKernel. It transforms the numerical variables of a feature space to form a new feature space where the dot product between features approximates the RBF Kernel product.

    See: Rahimi, A.,&Recht, B. (2007). Random Features for Large-Scale Kernel Machines. Neural Information Processing Systems. Retrieved from here
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      RFF_RBF()
      Creates a new RFF RBF object that will use an transformed feature space with a dimensionality of 512.
      RFF_RBF(double sigma)
      Creates a new RFF RBF object that will use an transformed feature space with a dimensionality of 512.
      RFF_RBF(double sigma, int dim)
      Creates a new RFF RBF object
      RFF_RBF(double sigma, int dim, boolean inMemory)
      Creates a new RFF RBF object
      RFF_RBF(int featurSize, double sigma, int dim, java.util.Random rand, boolean inMemory)
      Creates a new RFF RBF object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      RFF_RBF clone() 
      void fit(DataSet data)
      Fits this transform to the given dataset.
      int getDimensions()
      Returns the number of dimensions that will be used in the projected space
      double getSigma()
      Returns the σ value used for the RBF kernel approximation.
      Distribution guessSigma(DataSet d)
      Guess the distribution to use for the kernel width term σ in the RBF kernel being approximated.
      boolean isInMemory() 
      void setDimensions(int dimensions)
      Sets the number of dimensions in the new approximate space to use.
      void setInMemory(boolean inMemory)
      Sets whether or not the transform matrix is stored explicitly in memory or not.
      void setSigma(double sigma)
      Sets the σ parameter of the RBF kernel that is being approximated.
      DataPoint transform(DataPoint dp)
      Returns a new data point that is a transformation of the original data point.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RFF_RBF

        public RFF_RBF()
        Creates a new RFF RBF object that will use an transformed feature space with a dimensionality of 512. This constructor should be used with a parameter search to find a good value for sigma
      • RFF_RBF

        public RFF_RBF(double sigma)
        Creates a new RFF RBF object that will use an transformed feature space with a dimensionality of 512.
        Parameters:
        sigma - the positive sigma value for the RBFKernel
      • RFF_RBF

        public RFF_RBF(double sigma,
                       int dim)
        Creates a new RFF RBF object
        Parameters:
        sigma - the positive sigma value for the RBFKernel
        dim - the new feature size dimension to project into.
      • RFF_RBF

        public RFF_RBF(double sigma,
                       int dim,
                       boolean inMemory)
        Creates a new RFF RBF object
        Parameters:
        sigma - the positive sigma value for the RBFKernel
        dim - the new feature size dimension to project into.
        inMemory - true if the internal matrix should be stored in memory. If false, the memory will be re-computed as needed, increasing computation cost but uses no extra memory.
      • RFF_RBF

        public RFF_RBF(int featurSize,
                       double sigma,
                       int dim,
                       java.util.Random rand,
                       boolean inMemory)
        Creates a new RFF RBF object
        Parameters:
        featurSize - the number of numeric features in the original feature space
        sigma - the positive sigma value for the RBFKernel
        dim - the new feature size dimension to project into.
        rand - the source of randomness to initialize internal state
        inMemory - true if the internal matrix should be stored in memory. If false, the memory will be re-computed as needed, increasing computation cost but uses no extra memory.
    • Method Detail

      • fit

        public void fit(DataSet data)
        Description copied from interface: DataTransform
        Fits this transform to the given dataset. Some transforms can only be learned from classification or regression datasets. If an incompatible dataset type is given, a FailedToFitException exception may be thrown.
        Parameters:
        data - the dataset to fir this transform to
      • transform

        public DataPoint transform(DataPoint dp)
        Description copied from interface: DataTransform
        Returns a new data point that is a transformation of the original data point. This new data point is a different object, but may contain the same references as the original data point. It is not guaranteed that you can mutate the transformed point without having a side effect on the original point.
        Parameters:
        dp - the data point to apply a transformation to
        Returns:
        a transformed data point
      • setInMemory

        public void setInMemory(boolean inMemory)
        Sets whether or not the transform matrix is stored explicitly in memory or not. Explicit storage is often faster, but can be prohibitive for large feature sizes
        Parameters:
        inMemory - true to explicitly store the transform matrix, false to re-create it on the fly as needed
      • isInMemory

        public boolean isInMemory()
        Returns:
        true if this object will explicitly store the transform matrix, false to re-create it on the fly as needed
      • setDimensions

        public void setDimensions(int dimensions)
        Sets the number of dimensions in the new approximate space to use. This will be the number of numeric features in the transformed data, and larger values increase the accuracy of the approximation.
        Parameters:
        dimensions -
      • getDimensions

        public int getDimensions()
        Returns the number of dimensions that will be used in the projected space
        Returns:
        the number of dimensions that will be used in the projected space
      • setSigma

        public void setSigma(double sigma)
        Sets the σ parameter of the RBF kernel that is being approximated.
        Parameters:
        sigma - the positive value to use for σ
        See Also:
        RBFKernel.setSigma(double)
      • getSigma

        public double getSigma()
        Returns the σ value used for the RBF kernel approximation.
        Returns:
        the σ value used for the RBF kernel approximation.
      • guessSigma

        public Distribution guessSigma(DataSet d)
        Guess the distribution to use for the kernel width term σ in the RBF kernel being approximated.
        Parameters:
        d - the data set to get the guess for
        Returns:
        the guess for the σ parameter in the RBF Kernel

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.