DataType
- The type of data used with the kernel that the function can be
applied to.public static class KernelPrincipalComponentsAnalysis.Function<DataType> extends DefaultKernelContainer<DataType> implements VectorOutputEvaluator<DataType,Vector>
Modifier and Type | Field and Description |
---|---|
protected boolean |
centerData
A flag indicating if the incoming data needs to be centered or not.
|
protected Matrix |
components
The matrix of components for the function.
|
protected java.util.List<? extends DataType> |
data
The data that the KPCA was performed over.
|
protected Matrix |
kernelMatrix
The kernel matrix for all the data the KPCA was done over.
|
kernel
Constructor and Description |
---|
Function()
Creates a new, empty Kernel Principal Components Analysis function.
|
Function(Kernel<? super DataType> kernel,
java.util.List<? extends DataType> data,
Matrix components,
boolean centerData,
Matrix kernelMatrix)
Creates a new Kernel Principal Components Analysis function.
|
Modifier and Type | Method and Description |
---|---|
Vector |
evaluate(DataType input)
Evaluates the function on the given input and returns the output.
|
int |
getComponentCount()
Gets the number of components in the analysis result.
|
Matrix |
getComponents()
Gets the matrix of components from the analysis.
|
java.util.List<? extends DataType> |
getData()
Gets the data that was used in the analysis.
|
Matrix |
getKernelMatrix()
Gets the kernel matrix for the data that the analysis was done over.
|
int |
getOutputDimensionality()
Gets the expected dimensionality of the output vector of the evaluator,
if it is known.
|
boolean |
isCenterData()
Gets whether or not the data needs to be centered in the kernel space
before applying the function.
|
void |
setCenterData(boolean centerData)
Sets whether or not the data needs to be centered in the kernel space
before applying the function.
|
void |
setComponents(Matrix components)
Sets the matrix of components from the analysis.
|
void |
setData(java.util.List<? extends DataType> data)
Sets the data that was used in the analysis.
|
void |
setKernelMatrix(Matrix kernelMatrix)
Sets the kernel matrix for the data that the analysis was done over.
|
clone, getKernel, setKernel
protected java.util.List<? extends DataType> data
protected Matrix components
protected boolean centerData
protected Matrix kernelMatrix
public Function()
public Function(Kernel<? super DataType> kernel, java.util.List<? extends DataType> data, Matrix components, boolean centerData, Matrix kernelMatrix)
kernel
- The kernel to use.data
- The base data used in the KPCA analysis.components
- The matrix of components for the function.centerData
- True to center the data. Must correspond to whether or not
the analysis was done with centered data.kernelMatrix
- The kernel matrix. Must be provided if data centering is
true.public Vector evaluate(DataType input)
Evaluator
public int getOutputDimensionality()
VectorOutputEvaluator
getOutputDimensionality
in interface VectorOutputEvaluator<DataType,Vector>
public int getComponentCount()
public java.util.List<? extends DataType> getData()
public void setData(java.util.List<? extends DataType> data)
data
- The data that was used in the analysis.public Matrix getComponents()
public void setComponents(Matrix components)
components
- The component matrix.public boolean isCenterData()
public void setCenterData(boolean centerData)
centerData
- True if the function will apply to the centered version of the
input data. False if it will just apply directly to the given
data.public Matrix getKernelMatrix()
public void setKernelMatrix(Matrix kernelMatrix)
kernelMatrix
- The data kernel matrix.