|
Mobios v0.91 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mobios.index.algorithms.PCA
public class PCA
Do the Principal Component Analysis (PCA), using the Colt library. PCA no longer supports ShiftSize
Constructor Summary | |
---|---|
PCA()
|
Method Summary | |
---|---|
static void |
main(String[] args)
|
static cern.colt.matrix.DoubleMatrix2D |
pairWiseDistance(Metric metric,
List<? extends IndexObject> data)
|
static int[] |
pivotSelection(Metric metric,
List<? extends IndexObject> data,
int numPC,
int eachPC,
boolean print)
pivot selection by PCA |
static int[] |
pivotSelection(Metric metric,
List<? extends IndexObject> data,
int numPC,
int eachPC,
boolean print,
double[] eigenValue)
pivot selection by PCA |
static int[] |
pivotSelectionByPCAResultAngle(cern.colt.matrix.DoubleMatrix2D pcaResult,
int numP)
pivot selection based on the result of PCA. |
static int[] |
pivotSelectionByPCAResultProjection(cern.colt.matrix.DoubleMatrix2D data,
cern.colt.matrix.DoubleMatrix2D pcaResult,
int numPC,
int numP)
Pivot selection based on the result of PCA. |
static cern.colt.matrix.linalg.EigenvalueDecomposition |
runPCA(cern.colt.matrix.DoubleMatrix2D matrix)
|
static cern.colt.matrix.linalg.EigenvalueDecomposition |
runPCA(cern.colt.matrix.DoubleMatrix2D matrix,
boolean print)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PCA()
Method Detail |
---|
public static cern.colt.matrix.linalg.EigenvalueDecomposition runPCA(cern.colt.matrix.DoubleMatrix2D matrix)
public static cern.colt.matrix.linalg.EigenvalueDecomposition runPCA(cern.colt.matrix.DoubleMatrix2D matrix, boolean print)
public static cern.colt.matrix.DoubleMatrix2D pairWiseDistance(Metric metric, List<? extends IndexObject> data)
public static int[] pivotSelectionByPCAResultAngle(cern.colt.matrix.DoubleMatrix2D pcaResult, int numP)
pcaResult
- PCA result: A DoubleMatrix2D
of size [pcNum x (dim +1)],
the first column is the variance of each PC in descending order.
The remain of each row is a PCnumP
- number of pivots to select, should not be greater than the number of columns (dim) of the input PCA result matrix.
public static int[] pivotSelectionByPCAResultProjection(cern.colt.matrix.DoubleMatrix2D data, cern.colt.matrix.DoubleMatrix2D pcaResult, int numPC, int numP)
data
- the data set, each row is a point. Since the PCs are from the origin, the data should already be centerized.pcaResult
- PCA result: A DoubleMatrix2D
of size [pcNum x (dim +1)],
the first column is the variance (eigenvalue) of each PC in descending order.
The remain of each row is a PCnumPC
- the number of largest PCs to considernumP
- number of pivots to select, should not be greater than the number of columns (dim) of the input PCA result matrix.
public static int[] pivotSelection(Metric metric, List<? extends IndexObject> data, int numPC, int eachPC, boolean print)
metric
- data
- numPC
- how many Principal Components to checkeachPC
- from each PC, how many pivots will be selected by each method. two methods now.print
- whether to print debug information
public static int[] pivotSelection(Metric metric, List<? extends IndexObject> data, int numPC, int eachPC, boolean print, double[] eigenValue)
metric
- data
- numPC
- how many Principal Components to checkeachPC
- from each PC, how many pivots will be selected by each method. two methods now.print
- whether to print debug informationeigenValue
- an array to store the sums of eigenvalues
public static void main(String[] args) throws Exception
Exception
|
Mobios v0.91 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |