Class PCA

    • Field Detail

      • m_AttributeRange

        protected WekaAttributeRange m_AttributeRange
        the range of attributes to work.
      • m_Variance

        protected double m_Variance
        the variance to cover.
      • m_MaxAttributes

        protected int m_MaxAttributes
        the maximum number of attributes.
      • m_MaxAttributeNames

        protected int m_MaxAttributeNames
        the maximum number of attribute names.
      • m_SkipNominal

        protected boolean m_SkipNominal
        whether to skip nominal attributes (and not apply NominalToBinary).
      • m_Loadings

        protected SpreadSheet m_Loadings
        the loadings.
      • m_Supported

        protected gnu.trove.list.TIntList m_Supported
        the supported attributes.
      • m_Unsupported

        protected gnu.trove.list.TIntList m_Unsupported
        the unsupported attributes.
      • m_Kept

        protected ArrayList<Integer> m_Kept
        the indices of the kept attributes.
      • m_NumAttributes

        protected int m_NumAttributes
        the number of attributes in the data (excl class).
    • Constructor Detail

      • PCA

        public PCA()
    • Method Detail

      • setAttributeRange

        public void setAttributeRange​(WekaAttributeRange value)
        Sets the attribute range parameter.
        Parameters:
        value - the range
      • getAttributeRange

        public WekaAttributeRange getAttributeRange()
        Returns the attribute range parameter.
        Returns:
        the range
      • attributeRangeTipText

        public String attributeRangeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setVariance

        public void setVariance​(double value)
        Sets the variance.
        Parameters:
        value - the variance
      • getVariance

        public double getVariance()
        Returns the variance.
        Returns:
        the variance
      • varianceTipText

        public String varianceTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setMaxAttributes

        public void setMaxAttributes​(int value)
        Sets the maximum attributes.
        Parameters:
        value - the maximum
      • getMaxAttributes

        public int getMaxAttributes()
        Returns the maximum attributes.
        Returns:
        the maximum
      • maxAttributesTipText

        public String maxAttributesTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setMaxAttributeNames

        public void setMaxAttributeNames​(int value)
        Sets the maximum number of attribute names.
        Parameters:
        value - the maximum
      • getMaxAttributeNames

        public int getMaxAttributeNames()
        Returns the maximum number of attribute names.
        Returns:
        the maximum
      • maxAttributeNamesTipText

        public String maxAttributeNamesTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setSkipNominal

        public void setSkipNominal​(boolean value)
        Sets whether to skip NOMINAL attributes from the PCA process by turning them into STRING attributes.
        Parameters:
        value - true if to skip
      • getSkipNominal

        public boolean getSkipNominal()
        Returns whether to skip NOMINAL attributes from the PCA process by turning them into STRING attributes.
        Returns:
        true if to skip
      • skipNominalTipText

        public String skipNominalTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • check

        protected void check​(weka.core.Instances data)
        Hook method for checks.
        Overrides:
        check in class AbstractAnalysis<weka.core.Instances>
        Parameters:
        data - the data to check
      • extractLoadings

        protected SpreadSheet extractLoadings​(weka.core.Instances data,
                                              ArrayList<ArrayList<Double>> coeff)
        Create a spreadsheet to output from the coefficients 2D array
        Parameters:
        data - the underlying dataset
        coeff - The coefficients from the principal components analysis
        Returns:
        A spreadsheet containing the components
      • doAnalyze

        protected String doAnalyze​(weka.core.Instances data)
                            throws Exception
        Performs the actual analysis.
        Specified by:
        doAnalyze in class AbstractAnalysis<weka.core.Instances>
        Parameters:
        data - the data to analyze
        Returns:
        null if successful, otherwise error message
        Throws:
        Exception - if analysis fails
      • getLoadings

        public SpreadSheet getLoadings()
        Returns the loadings.
        Returns:
        the loadings, null if not available
      • getScores

        public SpreadSheet getScores()
        Returns the scores.
        Returns:
        the scores, null if not available