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.RandomizableClassifierA 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 PLSm_ActualFilterthe actual filter to useprotected AbstractPLSm_Algorithmthe PLS algorithm
-
Constructor Summary
Constructors Constructor Description PLSRegressor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringalgorithmTipText()Returns the tip text for this propertyvoidbuildClassifier(weka.core.Instances data)builds the classifierdoubleclassifyInstance(weka.core.Instance instance)Classifies the given test instance.AbstractPLSgetAlgorithm()Returns the PLS algorithm to use.weka.core.CapabilitiesgetCapabilities()Returns default capabilities of the classifier.protected AbstractPLSgetDefaultAlgorithm()Returns the default algorithm.String[]getOptions()returns the options of the current setupStringgetRevision()Returns the revision string.StringglobalInfo()Returns a string describing classifierEnumeration<weka.core.Option>listOptions()Gets an enumeration describing the available options.static voidmain(String[] args)Main method for running this classifier from commandline.voidsetAlgorithm(AbstractPLS value)Sets the PLS algorithm to use.voidsetOptions(String[] options)Parses the options for this object.StringtoString()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:
listOptionsin interfaceweka.core.OptionHandler- Overrides:
listOptionsin classweka.classifiers.RandomizableClassifier- Returns:
- an enumeration of all the available options.
-
getOptions
public String[] getOptions()
returns the options of the current setup- Specified by:
getOptionsin interfaceweka.core.OptionHandler- Overrides:
getOptionsin classweka.classifiers.RandomizableClassifier- Returns:
- the current options
-
setOptions
public void setOptions(String[] options) throws Exception
Parses the options for this object.- Specified by:
setOptionsin interfaceweka.core.OptionHandler- Overrides:
setOptionsin 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:
getCapabilitiesin interfaceweka.core.CapabilitiesHandler- Specified by:
getCapabilitiesin interfaceweka.classifiers.Classifier- Overrides:
getCapabilitiesin classweka.classifiers.AbstractClassifier- Returns:
- the capabilities of this classifier
-
buildClassifier
public void buildClassifier(weka.core.Instances data) throws Exceptionbuilds the classifier- Parameters:
data- the training instances- Throws:
Exception- if something goes wrong
-
classifyInstance
public double classifyInstance(weka.core.Instance instance) throws ExceptionClassifies the given test instance. The instance has to belong to a dataset when it's being classified.- Specified by:
classifyInstancein interfaceweka.classifiers.Classifier- Overrides:
classifyInstancein 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:
getRevisionin interfaceweka.core.RevisionHandler- Overrides:
getRevisionin 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
-
-