de.lmu.ifi.dbs.elki.math.linearalgebra.pca
Class PCARunner<V extends NumberVector<? extends V,?>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.math.linearalgebra.pca.PCARunner<V>
Type Parameters:
V - Vector type
All Implemented Interfaces:
InspectionUtilFrequentlyScanned, Parameterizable
Direct Known Subclasses:
PCAFilteredRunner

public class PCARunner<V extends NumberVector<? extends V,?>>
extends Object
implements Parameterizable

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)


Nested Class Summary
static class PCARunner.Parameterizer<V extends NumberVector<? extends V,?>>
          Parameterization class.
 
Field Summary
protected  CovarianceMatrixBuilder<V> covarianceMatrixBuilder
          The covariance computation class.
static OptionID PCA_COVARIANCE_MATRIX
          Parameter to specify the class to compute the covariance matrix, must be a subclass of CovarianceMatrixBuilder.
 
Constructor Summary
PCARunner(CovarianceMatrixBuilder<V> covarianceMatrixBuilder)
          Constructor.
 
Method Summary
 CovarianceMatrixBuilder<V> getCovarianceMatrixBuilder()
          Get covariance matrix builder
 PCAResult processCovarMatrix(Matrix covarMatrix)
          Process an existing covariance Matrix
 PCAResult processDatabase(Relation<? extends V> database)
          Run PCA on the complete database
 PCAResult processEVD(EigenvalueDecomposition evd)
          Process an existing eigenvalue decomposition
 PCAResult processIds(DBIDs ids, Relation<? extends V> database)
          Run PCA on a collection of database IDs
<D extends NumberDistance<?,?>>
PCAResult
processQueryResult(Collection<DistanceResultPair<D>> results, Relation<? extends V> database)
          Run PCA on a QueryResult Collection
 void setCovarianceMatrixBuilder(CovarianceMatrixBuilder<V> covarianceBuilder)
          Set covariance matrix builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PCA_COVARIANCE_MATRIX

public static final OptionID PCA_COVARIANCE_MATRIX
Parameter to specify the class to compute the covariance matrix, must be a subclass of CovarianceMatrixBuilder.

Default value: CovarianceMatrixBuilder

Key: -pca.covariance


covarianceMatrixBuilder

protected CovarianceMatrixBuilder<V extends NumberVector<? extends V,?>> covarianceMatrixBuilder
The covariance computation class.

Constructor Detail

PCARunner

public PCARunner(CovarianceMatrixBuilder<V> covarianceMatrixBuilder)
Constructor.

Parameters:
covarianceMatrixBuilder - Class for computing the covariance matrix
Method Detail

processDatabase

public PCAResult processDatabase(Relation<? extends V> database)
Run PCA on the complete database

Parameters:
database - the database used
Returns:
PCA result

processIds

public PCAResult processIds(DBIDs ids,
                            Relation<? extends V> database)
Run PCA on a collection of database IDs

Parameters:
ids - a collection of ids
database - the database used
Returns:
PCA result

processQueryResult

public <D extends NumberDistance<?,?>> PCAResult processQueryResult(Collection<DistanceResultPair<D>> results,
                                                                    Relation<? extends V> database)
Run PCA on a QueryResult Collection

Parameters:
results - a collection of QueryResults
database - the database used
Returns:
PCA result

processCovarMatrix

public PCAResult processCovarMatrix(Matrix 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<V> getCovarianceMatrixBuilder()
Get covariance matrix builder

Returns:
covariance matrix builder in use

setCovarianceMatrixBuilder

public void setCovarianceMatrixBuilder(CovarianceMatrixBuilder<V> covarianceBuilder)
Set covariance matrix builder.

Parameters:
covarianceBuilder - New covariance matrix builder.

Release 0.4.0 (2011-09-20_1324)