Class PLSFilter
- java.lang.Object
-
- weka.filters.Filter
-
- weka.filters.SimpleFilter
-
- weka.filters.SimpleBatchFilter
-
- weka.filters.supervised.attribute.PLSFilter
-
- All Implemented Interfaces:
java.io.Serializable,CapabilitiesHandler,OptionHandler,RevisionHandler,TechnicalInformationHandler,SupervisedFilter
public class PLSFilter extends SimpleBatchFilter implements SupervisedFilter, TechnicalInformationHandler
Runs Partial Least Square Regression over the given instances and computes the resulting beta matrix for prediction.
By default it replaces missing values and centers the data.
For more information see:
Tormod Naes, Tomas Isaksson, Tom Fearn, Tony Davies (2002). A User Friendly Guide to Multivariate Calibration and Classification. NIR Publications.
StatSoft, Inc.. Partial Least Squares (PLS).
Bent Jorgensen, Yuri Goegebeur. Module 7: Partial least squares regression I.
S. de Jong (1993). SIMPLS: an alternative approach to partial least squares regression. Chemometrics and Intelligent Laboratory Systems. 18:251-263. BibTeX:@book{Naes2002, author = {Tormod Naes and Tomas Isaksson and Tom Fearn and Tony Davies}, publisher = {NIR Publications}, title = {A User Friendly Guide to Multivariate Calibration and Classification}, year = {2002}, ISBN = {0-9528666-2-5} } @misc{missing_id, author = {StatSoft, Inc.}, booktitle = {Electronic Textbook StatSoft}, title = {Partial Least Squares (PLS)}, HTTP = {http://www.statsoft.com/textbook/stpls.html} } @misc{missing_id, author = {Bent Jorgensen and Yuri Goegebeur}, booktitle = {ST02: Multivariate Data Analysis and Chemometrics}, title = {Module 7: Partial least squares regression I}, HTTP = {http://statmaster.sdu.dk/courses/ST02/module07/} } @article{Jong1993, author = {S. de Jong}, journal = {Chemometrics and Intelligent Laboratory Systems}, pages = {251-263}, title = {SIMPLS: an alternative approach to partial least squares regression}, volume = {18}, year = {1993} }Valid options are:-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: 5541 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intALGORITHM_PLS1the type of algorithm: PLS1static intALGORITHM_SIMPLSthe type of algorithm: SIMPLSstatic intPREPROCESSING_CENTERthe type of preprocessing: Centerstatic intPREPROCESSING_NONEthe type of preprocessing: Nonestatic intPREPROCESSING_STANDARDIZEthe type of preprocessing: Standardizestatic Tag[]TAGS_ALGORITHMthe types of algorithmstatic Tag[]TAGS_PREPROCESSINGthe types of preprocessing
-
Constructor Summary
Constructors Constructor Description PLSFilter()default constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringalgorithmTipText()Returns the tip text for this propertySelectedTaggetAlgorithm()Gets the type of algorithm to useCapabilitiesgetCapabilities()Returns the Capabilities of this filter.intgetNumComponents()returns the maximum number of attributes to use.java.lang.String[]getOptions()returns the options of the current setupbooleangetPerformPrediction()Gets whether the class attribute is updated with the predicted value.SelectedTaggetPreprocessing()Gets the type of preprocessing to usebooleangetReplaceMissing()Gets whether missing values are replace.java.lang.StringgetRevision()Returns the revision string.TechnicalInformationgetTechnicalInformation()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.java.lang.StringglobalInfo()Returns a string describing this classifier.java.util.EnumerationlistOptions()Gets an enumeration describing the available options.static voidmain(java.lang.String[] args)runs the filter with the given arguments.java.lang.StringnumComponentsTipText()Returns the tip text for this propertyjava.lang.StringperformPredictionTipText()Returns the tip text for this propertyjava.lang.StringpreprocessingTipText()Returns the tip text for this propertyjava.lang.StringreplaceMissingTipText()Returns the tip text for this propertyvoidsetAlgorithm(SelectedTag value)Sets the type of algorithm to usevoidsetNumComponents(int value)sets the maximum number of attributes to use.voidsetOptions(java.lang.String[] options)Parses the options for this object.voidsetPerformPrediction(boolean value)Sets whether to update the class attribute with the predicted value.voidsetPreprocessing(SelectedTag value)Sets the type of preprocessing to usevoidsetReplaceMissing(boolean value)Sets whether to replace missing values.-
Methods inherited from class weka.filters.SimpleBatchFilter
batchFinished, input
-
Methods inherited from class weka.filters.SimpleFilter
debugTipText, getDebug, setDebug, setInputFormat
-
Methods inherited from class weka.filters.Filter
batchFilterFile, filterFile, getCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, numPendingOutput, output, outputPeek, toString, useFilter, wekaStaticWrapper
-
-
-
-
Field Detail
-
ALGORITHM_SIMPLS
public static final int ALGORITHM_SIMPLS
the type of algorithm: SIMPLS- See Also:
- Constant Field Values
-
ALGORITHM_PLS1
public static final int ALGORITHM_PLS1
the type of algorithm: PLS1- See Also:
- Constant Field Values
-
TAGS_ALGORITHM
public static final Tag[] TAGS_ALGORITHM
the types of algorithm
-
PREPROCESSING_NONE
public static final int PREPROCESSING_NONE
the type of preprocessing: None- See Also:
- Constant Field Values
-
PREPROCESSING_CENTER
public static final int PREPROCESSING_CENTER
the type of preprocessing: Center- See Also:
- Constant Field Values
-
PREPROCESSING_STANDARDIZE
public static final int PREPROCESSING_STANDARDIZE
the type of preprocessing: Standardize- See Also:
- Constant Field Values
-
TAGS_PREPROCESSING
public static final Tag[] TAGS_PREPROCESSING
the types of preprocessing
-
-
Method Detail
-
globalInfo
public java.lang.String globalInfo()
Returns a string describing this classifier.- Specified by:
globalInfoin classSimpleFilter- Returns:
- a description of the classifier suitable for displaying in the explorer/experimenter gui
-
getTechnicalInformation
public 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:
getTechnicalInformationin interfaceTechnicalInformationHandler- Returns:
- the technical information about this class
-
listOptions
public java.util.Enumeration listOptions()
Gets an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Overrides:
listOptionsin classSimpleFilter- Returns:
- an enumeration of all the available options.
-
getOptions
public java.lang.String[] getOptions()
returns the options of the current setup- Specified by:
getOptionsin interfaceOptionHandler- Overrides:
getOptionsin classSimpleFilter- Returns:
- the current options
-
setOptions
public void setOptions(java.lang.String[] options) throws java.lang.ExceptionParses the options for this object. Valid options are:-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:
setOptionsin interfaceOptionHandler- Overrides:
setOptionsin classSimpleFilter- Parameters:
options- the options to use- Throws:
java.lang.Exception- if the option setting fails- See Also:
SimpleFilter.reset()
-
numComponentsTipText
public java.lang.String numComponentsTipText()
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
-
performPredictionTipText
public java.lang.String performPredictionTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setPerformPrediction
public void setPerformPrediction(boolean value)
Sets whether to update the class attribute with the predicted value.- Parameters:
value- if true the class value will be replaced by the predicted value.
-
getPerformPrediction
public boolean getPerformPrediction()
Gets whether the class attribute is updated with the predicted value.- Returns:
- true if the class attribute is updated
-
algorithmTipText
public java.lang.String algorithmTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setAlgorithm
public void setAlgorithm(SelectedTag value)
Sets the type of algorithm to use- Parameters:
value- the algorithm type
-
getAlgorithm
public SelectedTag getAlgorithm()
Gets the type of algorithm to use- Returns:
- the current algorithm type.
-
replaceMissingTipText
public java.lang.String replaceMissingTipText()
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
-
preprocessingTipText
public java.lang.String preprocessingTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setPreprocessing
public void setPreprocessing(SelectedTag value)
Sets the type of preprocessing to use- Parameters:
value- the preprocessing type
-
getPreprocessing
public SelectedTag getPreprocessing()
Gets the type of preprocessing to use- Returns:
- the current preprocessing type.
-
getCapabilities
public Capabilities getCapabilities()
Returns the Capabilities of this filter.- Specified by:
getCapabilitiesin interfaceCapabilitiesHandler- Overrides:
getCapabilitiesin classFilter- Returns:
- the capabilities of this object
- See Also:
Capabilities
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Overrides:
getRevisionin classFilter- Returns:
- the revision
-
main
public static void main(java.lang.String[] args)
runs the filter with the given arguments.- Parameters:
args- the commandline arguments
-
-