Class AbstractPLS

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, adams.core.TechnicalInformationHandler, Serializable, weka.core.CapabilitiesHandler, GenericPLSMatrixAccess
    Direct Known Subclasses:
    AbstractMultiClassPLS, AbstractSingleClassPLS

    public abstract class AbstractPLS
    extends adams.core.option.AbstractOptionHandler
    implements weka.core.CapabilitiesHandler, adams.core.TechnicalInformationHandler, GenericPLSMatrixAccess
    Ancestor for PLS implementations.
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Initialized

        protected boolean m_Initialized
        whether the scheme has been initialized.
      • m_PreprocessingType

        protected PreprocessingType m_PreprocessingType
        the preprocessing type to perform.
      • m_ReplaceMissing

        protected boolean m_ReplaceMissing
        whether to replace missing values
      • m_NumComponents

        protected int m_NumComponents
        the maximum number of components to generate
      • m_PredictionType

        protected PredictionType m_PredictionType
        the prediction type to perform.
      • m_OutputFormat

        protected weka.core.Instances m_OutputFormat
        the output format.
    • Constructor Detail

      • AbstractPLS

        public AbstractPLS()
    • Method Detail

      • getTechnicalInformation

        public abstract adams.core.TechnicalInformation getTechnicalInformation()
        Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.
        Specified by:
        getTechnicalInformation in interface adams.core.TechnicalInformationHandler
        Returns:
        the technical information about this class
      • 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 adams.core.option.AbstractOptionHandler
      • getDefaultPreprocessingType

        protected PreprocessingType getDefaultPreprocessingType()
        Returns the default preprocessing type.
        Returns:
        the default
      • setPreprocessingType

        public void setPreprocessingType​(PreprocessingType value)
        Sets the type of preprocessing to perform.
        Parameters:
        value - the type
      • getPreprocessingType

        public PreprocessingType getPreprocessingType()
        Returns the type of preprocessing to perform.
        Returns:
        the type
      • preprocessingTypeTipText

        public String preprocessingTypeTipText()
        Returns the tip text for this property
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • setReplaceMissing

        public void setReplaceMissing​(boolean value)
        Sets whether to replace missing values.
        Parameters:
        value - if true missing values are replaced with the ReplaceMissingValues filter.
      • getReplaceMissing

        public boolean getReplaceMissing()
        Gets whether missing values are replace.
        Returns:
        true if missing values are replaced with the ReplaceMissingValues filter
      • replaceMissingTipText

        public String replaceMissingTipText()
        Returns the tip text for this property
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • setNumComponents

        public void setNumComponents​(int value)
        sets the maximum number of attributes to use.
        Parameters:
        value - the maximum number of attributes
      • getNumComponents

        public int getNumComponents()
        returns the maximum number of attributes to use.
        Returns:
        the current maximum number of attributes
      • numComponentsTipText

        public String numComponentsTipText()
        Returns the tip text for this property
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • setPredictionType

        public void setPredictionType​(PredictionType value)
        Sets the type of prediction to perform. Calling this method does not result in a reset() call.
        Parameters:
        value - the type
      • getPredictionType

        public PredictionType getPredictionType()
        Returns the type of prediction to perform.
        Returns:
        the type
      • predictionTypeTipText

        public String predictionTypeTipText()
        Returns the tip text for this property
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • reset

        public void reset()
        Resets the scheme.
        Overrides:
        reset in class adams.core.option.AbstractOptionHandler
      • getCapabilities

        public weka.core.Capabilities getCapabilities()
        Returns the Capabilities of this filter.
        Specified by:
        getCapabilities in interface weka.core.CapabilitiesHandler
        Returns:
        the capabilities of this object
        See Also:
        Capabilities
      • getMatrix

        public abstract weka.core.matrix.Matrix getMatrix​(String name)
        Returns the matrix with the specified name.
        Specified by:
        getMatrix in interface GenericPLSMatrixAccess
        Parameters:
        name - the name of the matrix
        Returns:
        the matrix, null if not available
      • getLoadings

        public abstract weka.core.matrix.Matrix getLoadings()
        Returns the loadings, if available.
        Specified by:
        getLoadings in interface GenericPLSMatrixAccess
        Returns:
        the loadings, null if not available
      • isInitialized

        public boolean isInitialized()
        Returns whether the scheme has been initialized.
        Returns:
        true if initialized
      • determineOutputFormat

        public abstract weka.core.Instances determineOutputFormat​(weka.core.Instances input)
                                                           throws Exception
        Determines the output format based on the input format and returns this.
        Parameters:
        input - the input format to base the output format on
        Returns:
        the output format
        Throws:
        Exception - in case the determination goes wrong
      • getOutputFormat

        public weka.core.Instances getOutputFormat()
        Returns the output format.
        Returns:
        the output format
      • preTransform

        protected abstract weka.core.Instances preTransform​(weka.core.Instances instances,
                                                            Map<String,​Object> params)
                                                     throws Exception
        Preprocesses the data.
        Parameters:
        instances - the data to process
        params - additional parameters
        Returns:
        the preprocessed data
        Throws:
        Exception
      • doTransform

        protected abstract weka.core.Instances doTransform​(weka.core.Instances data,
                                                           Map<String,​Object> params)
                                                    throws Exception
        Transforms the data, initializes if necessary.
        Parameters:
        data - the data to use
        params - additional parameters
        Returns:
        the transformed data
        Throws:
        Exception
      • postTransform

        protected abstract weka.core.Instances postTransform​(weka.core.Instances instances,
                                                             Map<String,​Object> params)
                                                      throws Exception
        Postprocesses the data.
        Parameters:
        instances - the data to process
        params - additional parameters
        Returns:
        the postprocessed data
        Throws:
        Exception
      • transform

        public weka.core.Instances transform​(weka.core.Instances data)
                                      throws Exception
        Transforms the data, initializes if necessary.
        Parameters:
        data - the data to use
        Returns:
        the transformed data
        Throws:
        Exception