Class PCA

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, Serializable

    public class PCA
    extends AbstractWekaSpectrumAnalysis
    Performs principal components analysis.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -generator <adams.data.instances.AbstractInstanceGenerator> (property: generator)
        The generator to use for generating Weka data from the spectra.
        default: adams.data.instances.SimpleInstanceGenerator
     
    -pca <adams.data.instancesanalysis.PCA> (property: PCA)
        The PCA analysis setup to use.
        default: adams.data.instancesanalysis.PCA
     
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected adams.data.spreadsheet.SpreadSheet m_Loadings
      the loadings.
      protected adams.data.instancesanalysis.PCA m_PCA
      the PCA analysis to use.
      protected adams.data.spreadsheet.SpreadSheet m_Scores
      the scores.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Constructor Summary

      Constructors 
      Constructor Description
      PCA()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void defineOptions()
      Adds options to the internal list of options.
      protected String doAnalyze​(weka.core.Instances data)
      Performs the actual analysis.
      adams.data.spreadsheet.SpreadSheet getLoadings()
      Returns the loadings.
      adams.data.instancesanalysis.PCA getPCA()
      Returns the PCA analysis.
      adams.data.spreadsheet.SpreadSheet getScores()
      Returns the scores.
      String globalInfo()
      Returns a string describing the object.
      String PCATipText()
      Returns the tip text for this property.
      void setPCA​(adams.data.instancesanalysis.PCA value)
      Sets the PCA analysis.
      • Methods inherited from class adams.data.analysis.AbstractAnalysis

        analyze
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_PCA

        protected adams.data.instancesanalysis.PCA m_PCA
        the PCA analysis to use.
      • m_Loadings

        protected adams.data.spreadsheet.SpreadSheet m_Loadings
        the loadings.
      • m_Scores

        protected adams.data.spreadsheet.SpreadSheet m_Scores
        the scores.
    • Constructor Detail

      • PCA

        public PCA()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class AbstractWekaSpectrumAnalysis
      • setPCA

        public void setPCA​(adams.data.instancesanalysis.PCA value)
        Sets the PCA analysis.
        Parameters:
        value - the analysis
      • getPCA

        public adams.data.instancesanalysis.PCA getPCA()
        Returns the PCA analysis.
        Returns:
        the analysis
      • PCATipText

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

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

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

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