public class PCA extends Object
Constructor and Description |
---|
PCA() |
Modifier and Type | Method and Description |
---|---|
void |
eigenPCA(Jama.Matrix data,
boolean scale,
boolean debug)
Solving PCA using eigenvector decomposition
|
double[][] |
getCovariance() |
double[][] |
getDataProjected(Jama.Matrix data,
boolean debug) |
double[] |
getImportanceOfComponents() |
double |
getImportanceOfComponents(int numPC) |
double[][] |
getPC() |
double[] |
getV() |
static void |
main(String[] args) |
void |
principalComponentAnalysis(String fileName,
boolean eigen,
boolean scale)
PCA
|
void |
principalComponentAnalysis(Vector<Double> data,
int rows,
int cols,
boolean eigen,
boolean scale)
perform principal component analysis
|
void |
printImportanceOfComponents() |
void |
printPricipalComponents() |
void |
printPricipalComponents(String[] factors,
int numPCA) |
void |
printPricipalComponents(Vector<String> factors) |
void |
svdPCA(Jama.Matrix data,
boolean scale,
boolean debug)
Solving PCA using singular value decomposition (SVD) (more general solution)
|
public double[][] getCovariance()
public double[] getV()
public double[][] getPC()
public double[][] getDataProjected(Jama.Matrix data, boolean debug)
public void printPricipalComponents()
public void printPricipalComponents(String[] factors, int numPCA)
factors
- linguistic factorsnumPCA
- number of PC, between 1 and Max num PCspublic void printImportanceOfComponents()
public double[] getImportanceOfComponents()
public double getImportanceOfComponents(int numPC)
public void principalComponentAnalysis(Vector<Double> data, int rows, int cols, boolean eigen, boolean scale)
data
- a vector of doublesrows
- number of rows, trials or examplescols
- number of cols, dimensions or factorseigen
- if true use eigenvalues, if false use SVD (singular value decomposition)scale
- if true use znormalisation, if false just remove the mean from each dimensionpublic void eigenPCA(Jama.Matrix data, boolean scale, boolean debug)
data
- Matrix with M rows corresponding to dimensions or factors and N columns corresponding to trials or examplesscale
- if true : applying zscore normalisation if false: just removing the meandebug
- debugpublic void svdPCA(Jama.Matrix data, boolean scale, boolean debug)
data
- Matrix with M rows corresponding to dimensions or factors and N columns corresponding to trials or examples * @param
scale if true : applying zscore normalisation if false: just removing the meanscale
- scaledebug
- debugpublic void principalComponentAnalysis(String fileName, boolean eigen, boolean scale)
fileName
- data one column per dimension or linguistic factoreigen
- if true use eigenvalues, if false use svd (recomended)scale
- if true use z-normalisation (recomended), if false substract off the mean for ecah dimensionCopyright © 2000–2016 DFKI GmbH. All rights reserved.