Class 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
    • 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 ids
        database - 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 QueryResults
        database - 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.