DataType
- The type of data that the analysis is to be done over. It must match
the input type of the kernel function that is given.@PublicationReference(author={"Bernard Scholkopf","Alexander Smola","Klaus-Robert Muller"},title="Nonlinear Component Analysis as a Kernel Eigenvalue Problem",year=1996,type=TechnicalReport,url="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.29.1366") @PublicationReference(author={"John Shawe-Taylor","Nello Christianini"},title="Kernel Methods for Pattern Analysis",year=2004,type=Book,pages={150,153}) public class KernelPrincipalComponentsAnalysis<DataType> extends DefaultKernelContainer<DataType> implements BatchLearner<java.util.Collection<? extends DataType>,KernelPrincipalComponentsAnalysis.Function<DataType>>
Modifier and Type | Class and Description |
---|---|
static class |
KernelPrincipalComponentsAnalysis.Function<DataType>
The resulting transformation function learned by Kernel Principal
Components Analysis.
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
centerData
Whether or not the data should be centered before doing KPCA.
|
protected int |
componentCount
The number of components to create from the analysis.
|
static boolean |
DEFAULT_CENTER_DATA
The default setting for centering data is true.
|
static int |
DEFAULT_COMPONENT_COUNT
The default number of components to create is 10.
|
kernel
Constructor and Description |
---|
KernelPrincipalComponentsAnalysis()
Creates a new Kernel Principal Components Analysis with a null kernel
and a default component count.
|
KernelPrincipalComponentsAnalysis(Kernel<? super DataType> kernel,
int componentCount)
Creates a new Kernel Principal Components Analysis with the given
kernel and component count.
|
KernelPrincipalComponentsAnalysis(Kernel<? super DataType> kernel,
int componentCount,
boolean centerData)
Creates a new Kernel Principal Components Analysis with the given
kernel and component count.
|
Modifier and Type | Method and Description |
---|---|
int |
getComponentCount()
Gets the number of components the analysis attempts to find.
|
boolean |
isCenterData()
Gets whether or not the data needs to be centered in the kernel space
before applying the algorithm.
|
KernelPrincipalComponentsAnalysis.Function<DataType> |
learn(java.util.Collection<? extends DataType> data)
The
learn method creates an object of ResultType using
data of type DataType , using some form of "learning" algorithm. |
void |
setCenterData(boolean centerData)
Sets whether or not the data needs to be centered in the kernel space
before applying the algorithm.
|
void |
setComponentCount(int componentCount)
Gets the number of components the analysis attempts to find.
|
clone, getKernel, setKernel
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone
public static final int DEFAULT_COMPONENT_COUNT
public static final boolean DEFAULT_CENTER_DATA
protected int componentCount
protected boolean centerData
public KernelPrincipalComponentsAnalysis()
public KernelPrincipalComponentsAnalysis(Kernel<? super DataType> kernel, int componentCount)
kernel
- The kernel to use in the analysis.componentCount
- The number of components for the analysis to create.
Must be positive.public KernelPrincipalComponentsAnalysis(Kernel<? super DataType> kernel, int componentCount, boolean centerData)
kernel
- The kernel to use in the analysis.componentCount
- The number of components for the analysis to create.
Must be positive.centerData
- True to center the data in the input space before applying the
analysis. Only set this to false if the data is pre-centered. If
in doubt, set to true.public KernelPrincipalComponentsAnalysis.Function<DataType> learn(java.util.Collection<? extends DataType> data)
BatchLearner
learn
method creates an object of ResultType
using
data of type DataType
, using some form of "learning" algorithm.learn
in interface BatchLearner<java.util.Collection<? extends DataType>,KernelPrincipalComponentsAnalysis.Function<DataType>>
data
- The data that the learning algorithm will use to create an
object of ResultType
.public int getComponentCount()
public void setComponentCount(int componentCount)
componentCount
- The number of components for the analysis. Must be positive.public boolean isCenterData()
public void setCenterData(boolean centerData)
centerData
- True if the algorithm will apply to the centered version of the
input data. False if it will just apply directly to the given
data.