public class KernelPCA extends DataTransformBase
PCA
. Because this works in a different
feature space, it will do its own centering in the kernel space.
Nystrom
is
used to reduce the data set to a reasonable approximation.
Nystrom.SamplingMethod
,
Serialized FormModifier | Constructor and Description |
---|---|
|
KernelPCA()
Creates a new Kernel PCA transform object using the
RBF Kernel and 100 dimensions |
|
KernelPCA(int dimensions)
Creates a new Kernel PCA transform object using the
RBF Kernel |
protected |
KernelPCA(KernelPCA toCopy)
Copy constructor
|
|
KernelPCA(KernelTrick k,
DataSet ds,
int dimensions,
int basisSize,
Nystrom.SamplingMethod samplingMethod)
Creates a new Kernel PCA transform object
|
|
KernelPCA(KernelTrick k,
int dimensions)
Creates a new Kernel PCA transform object
|
|
KernelPCA(KernelTrick k,
int dimensions,
int basisSize,
Nystrom.SamplingMethod samplingMethod)
Creates a new Kernel PCA transform object
|
Modifier and Type | Method and Description |
---|---|
KernelPCA |
clone() |
void |
fit(DataSet ds)
Fits this transform to the given dataset.
|
Nystrom.SamplingMethod |
getBasisSamplingMethod()
Returns the method of selecting the basis vectors
|
int |
getBasisSize()
Returns the number of basis vectors to use
|
int |
getDimensions()
Returns the number of dimensions to project down too
|
KernelTrick |
getKernel() |
static Distribution |
guessDimensions(DataSet d) |
void |
setBasisSamplingMethod(Nystrom.SamplingMethod method)
Sets the method of selecting the basis vectors
|
void |
setBasisSize(int basisSize)
Sets the basis size for the Kernel PCA to be learned from.
|
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.
|
void |
setKernel(KernelTrick k) |
DataPoint |
transform(DataPoint dp)
Returns a new data point that is a transformation of the original data
point.
|
getParameter, getParameters
public KernelPCA()
RBF Kernel
and 100 dimensionspublic KernelPCA(int dimensions)
RBF Kernel
dimensions
- the number of dimensions to project down to. Must be
less than than the basis sizepublic KernelPCA(KernelTrick k, int dimensions)
k
- the kernel trick to usedimensions
- the number of dimensions to project down to. Must be
less than than the basis sizepublic KernelPCA(KernelTrick k, int dimensions, int basisSize, Nystrom.SamplingMethod samplingMethod)
k
- the kernel trick to usedimensions
- the number of dimensions to project down to. Must be
less than than the basis sizebasisSize
- 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 vectorspublic KernelPCA(KernelTrick k, DataSet ds, int dimensions, int basisSize, Nystrom.SamplingMethod samplingMethod)
k
- the kernel trick to useds
- the data set to form the data transform fromdimensions
- the number of dimensions to project down to. Must be
less than than the basis sizebasisSize
- 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 vectorsprotected KernelPCA(KernelPCA toCopy)
toCopy
- the object to copypublic void fit(DataSet ds)
DataTransform
FailedToFitException
exception may be
thrown.ds
- the dataset to fir this transform topublic DataPoint transform(DataPoint dp)
DataTransform
dp
- the data point to apply a transformation topublic KernelPCA clone()
clone
in interface DataTransform
clone
in class DataTransformBase
public void setKernel(KernelTrick k)
k
- the kernel trick to usepublic KernelTrick getKernel()
public void setBasisSize(int basisSize)
basisSize
- the number of basis vectors to build Kernel PCA frompublic int getBasisSize()
public void setDimensions(int dimensions)
dimensions
- the number of dimensions to project down toopublic int getDimensions()
public void setBasisSamplingMethod(Nystrom.SamplingMethod method)
method
- the method of selecting the basis vectorspublic Nystrom.SamplingMethod getBasisSamplingMethod()
public static Distribution guessDimensions(DataSet d)
Copyright © 2017. All rights reserved.