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

Class KernelPCA

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


    public class KernelPCA
    extends DataTransformBase
    A kernelized implementation of PCA. Because this works in a different feature space, it will do its own centering in the kernel space.

    KernelPCA is expensive to compute at O(n3) work, where n is the number of data points. For this reason, sampling from Nystrom is used to reduce the data set to a reasonable approximation.

    See: Schölkopf, B., Smola, A.,&Müller, K.-R. (1998). Nonlinear Component Analysis as a Kernel Eigenvalue Problem. Neural Computation, 10(5), 1299–1319. doi:10.1162/089976698300017467
    See Also:
    Nystrom.SamplingMethod, Serialized Form
    • Constructor Detail

      • KernelPCA

        public KernelPCA()
        Creates a new Kernel PCA transform object using the RBF Kernel and 100 dimensions
      • KernelPCA

        public KernelPCA(int dimensions)
        Creates a new Kernel PCA transform object using the RBF Kernel
        Parameters:
        dimensions - the number of dimensions to project down to. Must be less than than the basis size
      • KernelPCA

        public KernelPCA(KernelTrick k,
                         int dimensions)
        Creates a new Kernel PCA transform object
        Parameters:
        k - the kernel trick to use
        dimensions - the number of dimensions to project down to. Must be less than than the basis size
      • KernelPCA

        public KernelPCA(KernelTrick k,
                         int dimensions,
                         int basisSize,
                         Nystrom.SamplingMethod samplingMethod)
        Creates a new Kernel PCA transform object
        Parameters:
        k - the kernel trick to use
        dimensions - the number of dimensions to project down to. Must be less than than the basis size
        basisSize - the number of points from the data set to select. If larger than the number of data points in the data set, the whole data set will be used.
        samplingMethod - the sampling method to select the basis vectors
      • KernelPCA

        public KernelPCA(KernelTrick k,
                         DataSet ds,
                         int dimensions,
                         int basisSize,
                         Nystrom.SamplingMethod samplingMethod)
        Creates a new Kernel PCA transform object
        Parameters:
        k - the kernel trick to use
        ds - the data set to form the data transform from
        dimensions - the number of dimensions to project down to. Must be less than than the basis size
        basisSize - the number of points from the data set to select. If larger than the number of data points in the data set, the whole data set will be used.
        samplingMethod - the sampling method to select the basis vectors
    • Method Detail

      • fit

        public void fit(DataSet ds)
        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:
        ds - 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
      • setKernel

        public void setKernel(KernelTrick k)
        Parameters:
        k - the kernel trick to use
      • getKernel

        public KernelTrick getKernel()
        Returns:
        the kernel trick to use
      • setBasisSize

        public void setBasisSize(int basisSize)
        Sets the basis size for the Kernel PCA to be learned from. Increasing the basis increase the accuracy of the transform, but increased the training time at a cubic rate.
        Parameters:
        basisSize - the number of basis vectors to build Kernel PCA from
      • getBasisSize

        public int getBasisSize()
        Returns the number of basis vectors to use
        Returns:
        the number of basis vectors to use
      • setDimensions

        public void setDimensions(int dimensions)
        Sets the dimension of the new feature space, which is the number of principal components to select from the kernelized feature space.
        Parameters:
        dimensions - the number of dimensions to project down too
      • getDimensions

        public int getDimensions()
        Returns the number of dimensions to project down too
        Returns:
        the number of dimensions to project down too
      • setBasisSamplingMethod

        public void setBasisSamplingMethod(Nystrom.SamplingMethod method)
        Sets the method of selecting the basis vectors
        Parameters:
        method - the method of selecting the basis vectors
      • getBasisSamplingMethod

        public Nystrom.SamplingMethod getBasisSamplingMethod()
        Returns the method of selecting the basis vectors
        Returns:
        the method of selecting the basis vectors

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.