weka.classifiers.functions
Class PLSClassifier

java.lang.Object
  extended by weka.classifiers.AbstractClassifier
      extended by weka.classifiers.functions.PLSClassifier
All Implemented Interfaces:
Serializable, Cloneable, weka.classifiers.Classifier, weka.core.CapabilitiesHandler, weka.core.OptionHandler, weka.core.RevisionHandler

public class PLSClassifier
extends weka.classifiers.AbstractClassifier

A wrapper classifier for the PLSFilter, utilizing the PLSFilter's ability to perform predictions.

Valid options are:

 -filter <filter specification>
  The PLS filter to use. Full classname of filter to include,  followed by scheme options.
  (default: weka.filters.supervised.attribute.PLSFilter)
 -D
  If set, classifier is run in debug mode and
  may output additional info to the console
 
 Options specific to filter weka.filters.supervised.attribute.PLSFilter ('-filter'):
 
 -D
  Turns on output of debugging information.
 -C <num>
  The number of components to compute.
  (default: 20)
 -U
  Updates the class attribute as well.
  (default: off)
 -M
  Turns replacing of missing values on.
  (default: off)
 -A <SIMPLS|PLS1>
  The algorithm to use.
  (default: PLS1)
 -P <none|center|standardize>
  The type of preprocessing that is applied to the data.
  (default: center)

Version:
$Revision: 8109 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Constructor Summary
PLSClassifier()
           
 
Method Summary
 void buildClassifier(weka.core.Instances data)
          builds the classifier
 double classifyInstance(weka.core.Instance instance)
          Classifies the given test instance.
 String filterTipText()
          Returns the tip text for this property
 weka.core.Capabilities getCapabilities()
          Returns default capabilities of the classifier.
 weka.filters.Filter getFilter()
          Get the PLS filter.
 String[] getOptions()
          returns the options of the current setup
 String getRevision()
          Returns the revision string.
 String globalInfo()
          Returns a string describing classifier
 Enumeration listOptions()
          Gets an enumeration describing the available options.
static void main(String[] args)
          Main method for running this classifier from commandline.
 void setFilter(weka.filters.Filter value)
          Set the PLS filter (only used for setup).
 void setOptions(String[] options)
          Parses the options for this object.
 String toString()
          returns a string representation of the classifier
 
Methods inherited from class weka.classifiers.AbstractClassifier
debugTipText, distributionForInstance, forName, getDebug, makeCopies, makeCopy, runClassifier, setDebug
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PLSClassifier

public PLSClassifier()
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.

Valid options are:

 -filter <filter specification>
  The PLS filter to use. Full classname of filter to include,  followed by scheme options.
  (default: weka.filters.supervised.attribute.PLSFilter)
 -D
  If set, classifier is run in debug mode and
  may output additional info to the console
 
 Options specific to filter weka.filters.supervised.attribute.PLSFilter ('-filter'):
 
 -D
  Turns on output of debugging information.
 -C <num>
  The number of components to compute.
  (default: 20)
 -U
  Updates the class attribute as well.
  (default: off)
 -M
  Turns replacing of missing values on.
  (default: off)
 -A <SIMPLS|PLS1>
  The algorithm to use.
  (default: PLS1)
 -P <none|center|standardize>
  The type of preprocessing that is applied to the data.
  (default: center)

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

filterTipText

public String filterTipText()
Returns the tip text for this property

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui

setFilter

public void setFilter(weka.filters.Filter value)
               throws Exception
Set the PLS filter (only used for setup).

Parameters:
value - the kernel filter.
Throws:
Exception - if not PLSFilter

getFilter

public weka.filters.Filter getFilter()
Get the PLS filter.

Returns:
the PLS filter

getCapabilities

public weka.core.Capabilities getCapabilities()
Returns default capabilities of the classifier.

Specified by:
getCapabilities in interface weka.classifiers.Classifier
Specified by:
getCapabilities in interface weka.core.CapabilitiesHandler
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

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 Utils.missingValue() if no prediction is made
Throws:
Exception - if an error occurred during the prediction

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


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.