Package weka.classifiers.functions
Class PLSRegressor
- java.lang.Object
-
- weka.classifiers.AbstractClassifier
-
- weka.classifiers.RandomizableClassifier
-
- weka.classifiers.functions.PLSRegressor
-
- All Implemented Interfaces:
Serializable
,Cloneable
,weka.classifiers.Classifier
,weka.core.BatchPredictor
,weka.core.CapabilitiesHandler
,weka.core.CapabilitiesIgnorer
,weka.core.CommandlineRunnable
,weka.core.OptionHandler
,weka.core.Randomizable
,weka.core.RevisionHandler
public class PLSRegressor extends weka.classifiers.RandomizableClassifier
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 algorithm to include, followed by scheme options. (default: adams.data.instancesanalysis.pls.PLS1)
-S <num> Random number seed. (default 1)
-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).
-batch-size The desired batch size for batch prediction (default 100).
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected PLS
m_ActualFilter
the actual filter to useprotected AbstractPLS
m_Algorithm
the PLS algorithm
-
Constructor Summary
Constructors Constructor Description PLSRegressor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
algorithmTipText()
Returns the tip text for this propertyvoid
buildClassifier(weka.core.Instances data)
builds the classifierdouble
classifyInstance(weka.core.Instance instance)
Classifies the given test instance.AbstractPLS
getAlgorithm()
Returns the PLS algorithm to use.weka.core.Capabilities
getCapabilities()
Returns default capabilities of the classifier.protected AbstractPLS
getDefaultAlgorithm()
Returns the default algorithm.String[]
getOptions()
returns the options of the current setupString
getRevision()
Returns the revision string.String
globalInfo()
Returns a string describing classifierEnumeration<weka.core.Option>
listOptions()
Gets an enumeration describing the available options.static void
main(String[] args)
Main method for running this classifier from commandline.void
setAlgorithm(AbstractPLS value)
Sets the PLS algorithm to use.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
batchSizeTipText, debugTipText, distributionForInstance, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
-
-
-
-
Field Detail
-
m_Algorithm
protected AbstractPLS m_Algorithm
the PLS algorithm
-
m_ActualFilter
protected PLS m_ActualFilter
the actual filter to use
-
-
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<weka.core.Option> listOptions()
Gets an enumeration describing the available options.- Specified by:
listOptions
in interfaceweka.core.OptionHandler
- Overrides:
listOptions
in classweka.classifiers.RandomizableClassifier
- Returns:
- an enumeration of all the available options.
-
getOptions
public String[] getOptions()
returns the options of the current setup- Specified by:
getOptions
in interfaceweka.core.OptionHandler
- Overrides:
getOptions
in classweka.classifiers.RandomizableClassifier
- Returns:
- the current options
-
setOptions
public void setOptions(String[] options) throws Exception
Parses the options for this object.- Specified by:
setOptions
in interfaceweka.core.OptionHandler
- Overrides:
setOptions
in classweka.classifiers.RandomizableClassifier
- Parameters:
options
- the options to use- Throws:
Exception
- if setting of options fails
-
getDefaultAlgorithm
protected AbstractPLS getDefaultAlgorithm()
Returns the default algorithm.- Returns:
- the default
-
setAlgorithm
public void setAlgorithm(AbstractPLS value)
Sets the PLS algorithm to use.- Parameters:
value
- the algorithm
-
getAlgorithm
public AbstractPLS getAlgorithm()
Returns the PLS algorithm to use.- Returns:
- the 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 interfaceweka.core.CapabilitiesHandler
- Specified by:
getCapabilities
in interfaceweka.classifiers.Classifier
- Overrides:
getCapabilities
in classweka.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 interfaceweka.classifiers.Classifier
- Overrides:
classifyInstance
in classweka.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
-
getRevision
public String getRevision()
Returns the revision string.- Specified by:
getRevision
in interfaceweka.core.RevisionHandler
- Overrides:
getRevision
in classweka.classifiers.AbstractClassifier
- Returns:
- the revision
-
main
public static void main(String[] args)
Main method for running this classifier from commandline.- Parameters:
args
- the options
-
-