public final class PCA extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PCA.TransformationType
Type of the possible data transformation.
|
Constructor and Description |
---|
PCA(Matrix data)
Create the PCA transformation.
|
PCA(Matrix data,
boolean center)
Create the PCA transformation.
|
PCA(Matrix data,
CovarianceMatrixEVDCalculator evdCalc)
Create the PCA transformation.
|
PCA(Matrix data,
CovarianceMatrixEVDCalculator evdCalc,
boolean center)
Create the PCA transformation
|
Modifier and Type | Method and Description |
---|---|
boolean |
belongsToGeneratedSubspace(Matrix pt)
Check if given point lies in PCA-generated subspace.
|
static Matrix |
calculateCovarianceMatrix(Matrix data)
Function for JUnit testing purposes only
|
double |
getEigenvalue(int dimNo)
Get selected eigenvalue
|
Matrix |
getEigenvectorsMatrix() |
int |
getInputDimsNo()
Get number of dimensions of the input vectors
|
int |
getOutputDimsNo()
Get number of dimensions of the output vectors
|
Matrix |
transform(Matrix data,
PCA.TransformationType type)
Execute selected transformation on given data.
|
public PCA(Matrix data)
data
- data matrix used to compute the PCA transformation.
Rows of the matrix are the instances/samples, columns are dimensions.
It is assumed that the matrix is already centered.public PCA(Matrix data, boolean center)
data
- data matrix used to compute the PCA transformation.
Rows of the matrix are the instances/samples, columns are dimensions.center
- should the data matrix be centered before doing the
calculations?public PCA(Matrix data, CovarianceMatrixEVDCalculator evdCalc)
data
- data matrix used to compute the PCA transformation.
Rows of the matrix are the instances/samples, columns are dimensions.
It is assumed that the matrix is already centered.evdCalc
- method of computing eigenvalue decomposition of data's
covariance matrixpublic PCA(Matrix data, CovarianceMatrixEVDCalculator evdCalc, boolean center)
data
- data matrix used to compute the PCA transformation.
Rows of the matrix are the instances/samples, columns are dimensions.evdCalc
- method of computing eigenvalue decomposition of data's
covariance matrixcenter
- should the data matrix be centered before doing the
calculations?public Matrix getEigenvectorsMatrix()
public double getEigenvalue(int dimNo)
dimNo
- dimension number corresponding to given eigenvaluepublic int getInputDimsNo()
public int getOutputDimsNo()
public Matrix transform(Matrix data, PCA.TransformationType type)
data
- data to transform. Rows of the matrix are the
instances/samples, columns are dimensions.
If the original PCA data matrix was set to be centered, this
matrix will also be centered using the same parameters.type
- transformation to applypublic boolean belongsToGeneratedSubspace(Matrix pt)
pt
- point. If the original PCA data matrix was set to be centered,
this point will also be centered using the same parameters.Jas4pp 1.5 © Java Analysis Studio for Particle Physics