Package elki.math.linearalgebra.pca
Class PCARunner
- java.lang.Object
-
- elki.math.linearalgebra.pca.PCARunner
-
- Direct Known Subclasses:
AutotuningPCA
public class PCARunner extends java.lang.Object
Class to run PCA on given data.The various methods will start PCA at different places (e.g., with database IDs, database query results, a precomputed covariance matrix or eigenvalue decomposition).
The runner can be parameterized by setting a covariance matrix builder (e.g. to a weighted covariance matrix builder)
- Since:
- 0.2
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PCARunner.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description protected CovarianceMatrixBuilder
covarianceMatrixBuilder
The covariance computation class.
-
Constructor Summary
Constructors Constructor Description PCARunner(CovarianceMatrixBuilder covarianceMatrixBuilder)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CovarianceMatrixBuilder
getCovarianceMatrixBuilder()
Get covariance matrix builder.PCAResult
processCovarMatrix(double[][] covarMatrix)
Process an existing covariance Matrix.PCAResult
processEVD(EigenvalueDecomposition evd)
Process an existing eigenvalue decomposition.PCAResult
processIds(DBIDs ids, Relation<? extends NumberVector> database)
Run PCA on a collection of database IDs.PCAResult
processQueryResult(DoubleDBIDList results, Relation<? extends NumberVector> database)
Run PCA on a QueryResult Collection.void
setCovarianceMatrixBuilder(CovarianceMatrixBuilder covarianceBuilder)
Set covariance matrix builder.
-
-
-
Field Detail
-
covarianceMatrixBuilder
protected CovarianceMatrixBuilder covarianceMatrixBuilder
The covariance computation class.
-
-
Constructor Detail
-
PCARunner
public PCARunner(CovarianceMatrixBuilder covarianceMatrixBuilder)
Constructor.- Parameters:
covarianceMatrixBuilder
- Class for computing the covariance matrix
-
-
Method Detail
-
processIds
public PCAResult processIds(DBIDs ids, Relation<? extends NumberVector> database)
Run PCA on a collection of database IDs.- Parameters:
ids
- a collection of idsdatabase
- the database used- Returns:
- PCA result
-
processQueryResult
public PCAResult processQueryResult(DoubleDBIDList results, Relation<? extends NumberVector> database)
Run PCA on a QueryResult Collection.- Parameters:
results
- a collection of QueryResultsdatabase
- the database used- Returns:
- PCA result
-
processCovarMatrix
public PCAResult processCovarMatrix(double[][] covarMatrix)
Process an existing covariance Matrix.- Parameters:
covarMatrix
- the matrix used for performing pca- Returns:
- PCA result
-
processEVD
public PCAResult processEVD(EigenvalueDecomposition evd)
Process an existing eigenvalue decomposition.- Parameters:
evd
- eigenvalue decomposition to use- Returns:
- PCA result
-
getCovarianceMatrixBuilder
public CovarianceMatrixBuilder getCovarianceMatrixBuilder()
Get covariance matrix builder.- Returns:
- covariance matrix builder in use
-
setCovarianceMatrixBuilder
public void setCovarianceMatrixBuilder(CovarianceMatrixBuilder covarianceBuilder)
Set covariance matrix builder.- Parameters:
covarianceBuilder
- New covariance matrix builder.
-
-