Class GlobalPrincipalComponentAnalysisTransform<O extends elki.data.NumberVector>

  • Type Parameters:
    O - Vector type
    All Implemented Interfaces:
    elki.datasource.filter.ObjectFilter

    @Alias({"whiten","whitening","pca"})
    @Priority(200)
    public class GlobalPrincipalComponentAnalysisTransform<O extends elki.data.NumberVector>
    extends AbstractVectorConversionFilter<O,​O>
    Apply Principal Component Analysis (PCA) to the data set.

    This is also popular form of "Whitening transformation", and will project the data to have a unit covariance matrix.

    If you want to also reduce dimensionality, set the -pca.filter parameter! Note that this implementation currently will always perform a full matrix inversion. For very high dimensional data, this can take an excessive amount of time O(d³) and memory O(d²). Please contribute a better implementation to ELKI that only computes the requiried dimensions, yet allows for the same filtering flexibility.

    TODO: design an API (and implementation) that allows plugging in efficient solvers that do not need to decompose the entire matrix. This may, however, require external dependencies such as jBlas.

    Since:
    0.5.0
    Author:
    Erich Schubert
    • Field Detail

      • LOG

        private static final elki.logging.Logging LOG
        Class logger.
      • filter

        elki.math.linearalgebra.pca.filter.EigenPairFilter filter
        Filter to use for dimensionality reduction.
      • covmat

        elki.math.linearalgebra.CovarianceMatrix covmat
        Covariance matrix builder.
      • proj

        double[][] proj
        Final projection after analysis run.
      • buf

        double[] buf
        Projection buffer.
      • mean

        double[] mean
        Vector for data set centering.
    • Constructor Detail

      • GlobalPrincipalComponentAnalysisTransform

        public GlobalPrincipalComponentAnalysisTransform​(elki.math.linearalgebra.pca.filter.EigenPairFilter filter)
        Constructor.
        Parameters:
        filter - Filter to use for dimensionality reduction.
      • GlobalPrincipalComponentAnalysisTransform

        public GlobalPrincipalComponentAnalysisTransform​(elki.math.linearalgebra.pca.filter.EigenPairFilter filter,
                                                         GlobalPrincipalComponentAnalysisTransform.Mode mode)
        Constructor.
        Parameters:
        filter - Filter to use for dimensionality reduction.
        mode - Mode
    • Method Detail

      • prepareStart

        protected boolean prepareStart​(elki.data.type.SimpleTypeInformation<O> in)
        Description copied from class: AbstractConversionFilter
        Return "true" when the normalization needs initialization (two-pass filtering!).
        Overrides:
        prepareStart in class AbstractConversionFilter<O extends elki.data.NumberVector,​O extends elki.data.NumberVector>
        Parameters:
        in - Input type information
        Returns:
        true or false
      • filterSingleObject

        protected O filterSingleObject​(O obj)
        Description copied from class: AbstractConversionFilter
        Normalize a single instance. You can implement this as UnsupportedOperationException if you override both public "normalize" functions!
        Specified by:
        filterSingleObject in class AbstractConversionFilter<O extends elki.data.NumberVector,​O extends elki.data.NumberVector>
        Parameters:
        obj - Database object to normalize
        Returns:
        Normalized database object
      • getInputTypeRestriction

        protected elki.data.type.SimpleTypeInformation<? super O> getInputTypeRestriction()
        Description copied from class: AbstractConversionFilter
        Get the input type restriction used for negotiating the data query.
        Specified by:
        getInputTypeRestriction in class AbstractConversionFilter<O extends elki.data.NumberVector,​O extends elki.data.NumberVector>
        Returns:
        Type restriction
      • convertedType

        protected elki.data.type.SimpleTypeInformation<? super O> convertedType​(elki.data.type.SimpleTypeInformation<O> in)
        Description copied from class: AbstractConversionFilter
        Get the output type from the input type after conversion.
        Specified by:
        convertedType in class AbstractConversionFilter<O extends elki.data.NumberVector,​O extends elki.data.NumberVector>
        Parameters:
        in - input type restriction
        Returns:
        output type restriction