Package weka.classifiers.functions
Class PLSWeighted
- java.lang.Object
-
- weka.classifiers.AbstractClassifier
-
- weka.classifiers.functions.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 algorithmprotected PLS
m_Filter
the actual filter to use
-
Constructor Summary
Constructors Constructor Description PLSWeighted()
-
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()
Get the PLS algorithm.weka.core.Capabilities
getCapabilities()
Returns default capabilities of the classifier.AbstractPLS
getDefaultAlgorithm()
Returns the default PLS filter.weka.core.matrix.Matrix
getLoadings()
Returns the loadings, if available.weka.core.matrix.Matrix
getMatrix(String name)
Returns the matrix with the specified name.String[]
getMatrixNames()
Returns the all the available matrices.String[]
getOptions()
returns the options of the current setupString
getRevision()
Returns the revision string.String
globalInfo()
Returns a string describing classifierboolean
hasLoadings()
Whether the algorithm supports return of loadings.Enumeration
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)
Set the PLS algorithm (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
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_Filter
protected PLS m_Filter
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 listOptions()
Gets an enumeration describing the available options.- Specified by:
listOptions
in interfaceweka.core.OptionHandler
- Overrides:
listOptions
in classweka.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 interfaceweka.core.OptionHandler
- Overrides:
getOptions
in classweka.classifiers.AbstractClassifier
- 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.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 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- Specified by:
buildClassifier
in interfaceweka.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 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 Instance.missingValue() if no prediction is made
- Throws:
Exception
- if an error occurred during the prediction
-
getMatrixNames
public String[] getMatrixNames()
Returns the all the available matrices.- Specified by:
getMatrixNames
in interfaceGenericPLSMatrixAccess
- Returns:
- the names of the matrices
-
getMatrix
public weka.core.matrix.Matrix getMatrix(String name)
Returns the matrix with the specified name.- Specified by:
getMatrix
in interfaceGenericPLSMatrixAccess
- Parameters:
name
- the name of the matrix- Returns:
- the matrix, null if not available
-
hasLoadings
public boolean hasLoadings()
Whether the algorithm supports return of loadings.- Specified by:
hasLoadings
in interfaceGenericPLSMatrixAccess
- Returns:
- true if supported
- See Also:
getLoadings()
-
getLoadings
public weka.core.matrix.Matrix getLoadings()
Returns the loadings, if available.- Specified by:
getLoadings
in interfaceGenericPLSMatrixAccess
- Returns:
- the loadings, null if not available
-
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
-
-