Class PLSWeighted

  • All Implemented Interfaces:
    Serializable, Cloneable, weka.classifiers.Classifier, weka.core.BatchPredictor, weka.core.CapabilitiesHandler, weka.core.CapabilitiesIgnorer, weka.core.CommandlineRunnable, GenericPLSMatrixAccess, weka.core.OptionHandler, weka.core.RevisionHandler, weka.core.WeightedInstancesHandler

    public class PLSWeighted
    extends weka.classifiers.AbstractClassifier
    implements weka.core.WeightedInstancesHandler, GenericPLSMatrixAccess
    A wrapper classifier for the PLS filter, utilizing the filter's ability to perform predictions.

    Valid options are:

     -algorithm <algorithm specification>
      The PLS algorithm to use. Full classname of filter to include,  followed by scheme options.
      (default: weka.filters.supervised.attribute.pls.PLS1)
     -output-debug-info
      If set, classifier is run in debug mode and
      may output additional info to the console
     -do-not-check-capabilities
      If set, classifier capabilities are not checked before classifier is built
      (use with caution).
     -num-decimal-places
      The number of decimal places for the output of numbers in the model (default 2).
     
     Options specific to algorithm weka.filters.supervised.attribute.pls.PLS1 ('-algorithm'):
     
     -debug <value>
      If enabled, additional info may be output to the console.
      (default: false)
     -preprocessing <value>
      The type of preprocessing to perform.
      (default: CENTER)
     -C <value>
      The number of components to compute.
      (default: 20)
     -prediction <value>
      The type of prediction to perform.
      (default: NONE)
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected AbstractPLS m_Algorithm
      the PLS algorithm
      protected PLS m_Filter
      the actual filter to use
      • Fields inherited from class weka.classifiers.AbstractClassifier

        BATCH_SIZE_DEFAULT, m_BatchSize, m_Debug, m_DoNotCheckCapabilities, m_numDecimalPlaces, NUM_DECIMAL_PLACES_DEFAULT
    • Constructor Summary

      Constructors 
      Constructor Description
      PLSWeighted()  
    • Field Detail

      • m_Algorithm

        protected AbstractPLS m_Algorithm
        the PLS algorithm
      • m_Filter

        protected PLS m_Filter
        the actual filter to use
    • Constructor Detail

      • PLSWeighted

        public PLSWeighted()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing classifier
        Returns:
        a description suitable for displaying in the explorer/experimenter gui
      • listOptions

        public Enumeration listOptions()
        Gets an enumeration describing the available options.
        Specified by:
        listOptions in interface weka.core.OptionHandler
        Overrides:
        listOptions in class weka.classifiers.AbstractClassifier
        Returns:
        an enumeration of all the available options.
      • getOptions

        public String[] getOptions()
        returns the options of the current setup
        Specified by:
        getOptions in interface weka.core.OptionHandler
        Overrides:
        getOptions in class weka.classifiers.AbstractClassifier
        Returns:
        the current options
      • setOptions

        public void setOptions​(String[] options)
                        throws Exception
        Parses the options for this object.
        Specified by:
        setOptions in interface weka.core.OptionHandler
        Overrides:
        setOptions in class weka.classifiers.AbstractClassifier
        Parameters:
        options - the options to use
        Throws:
        Exception - if setting of options fails
      • getDefaultAlgorithm

        public AbstractPLS getDefaultAlgorithm()
        Returns the default PLS filter.
        Returns:
        the default filter
      • setAlgorithm

        public void setAlgorithm​(AbstractPLS value)
        Set the PLS algorithm (only used for setup).
        Parameters:
        value - the algorithm
      • getAlgorithm

        public AbstractPLS getAlgorithm()
        Get the PLS algorithm.
        Returns:
        the PLS algorithm
      • algorithmTipText

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

        public weka.core.Capabilities getCapabilities()
        Returns default capabilities of the classifier.
        Specified by:
        getCapabilities in interface weka.core.CapabilitiesHandler
        Specified by:
        getCapabilities in interface weka.classifiers.Classifier
        Overrides:
        getCapabilities in class weka.classifiers.AbstractClassifier
        Returns:
        the capabilities of this classifier
      • buildClassifier

        public void buildClassifier​(weka.core.Instances data)
                             throws Exception
        builds the classifier
        Specified by:
        buildClassifier in interface weka.classifiers.Classifier
        Parameters:
        data - the training instances
        Throws:
        Exception - if something goes wrong
      • classifyInstance

        public double classifyInstance​(weka.core.Instance instance)
                                throws Exception
        Classifies the given test instance. The instance has to belong to a dataset when it's being classified.
        Specified by:
        classifyInstance in interface weka.classifiers.Classifier
        Overrides:
        classifyInstance in class weka.classifiers.AbstractClassifier
        Parameters:
        instance - the instance to be classified
        Returns:
        the predicted most likely class for the instance or Instance.missingValue() if no prediction is made
        Throws:
        Exception - if an error occurred during the prediction
      • getMatrix

        public 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 weka.core.matrix.Matrix getLoadings()
        Returns the loadings, if available.
        Specified by:
        getLoadings in interface GenericPLSMatrixAccess
        Returns:
        the loadings, null if not available
      • toString

        public String toString()
        returns a string representation of the classifier
        Overrides:
        toString in class Object
        Returns:
        a string representation of the classifier
      • getRevision

        public String getRevision()
        Returns the revision string.
        Specified by:
        getRevision in interface weka.core.RevisionHandler
        Overrides:
        getRevision in class weka.classifiers.AbstractClassifier
        Returns:
        the revision
      • main

        public static void main​(String[] args)
        Main method for running this classifier from commandline.
        Parameters:
        args - the options