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 AbstractPLSm_Algorithmthe PLS algorithmprotected PLSm_Filterthe 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 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()Get the PLS algorithm.weka.core.CapabilitiesgetCapabilities()Returns default capabilities of the classifier.AbstractPLSgetDefaultAlgorithm()Returns the default PLS filter.weka.core.matrix.MatrixgetLoadings()Returns the loadings, if available.weka.core.matrix.MatrixgetMatrix(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 setupStringgetRevision()Returns the revision string.StringglobalInfo()Returns a string describing classifierbooleanhasLoadings()Whether the algorithm supports return of loadings.EnumerationlistOptions()Gets an enumeration describing the available options.static voidmain(String[] args)Main method for running this classifier from commandline.voidsetAlgorithm(AbstractPLS value)Set the PLS algorithm (only used for setup).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_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:
listOptionsin interfaceweka.core.OptionHandler- Overrides:
listOptionsin classweka.classifiers.AbstractClassifier- 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.AbstractClassifier- 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.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:
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- Specified by:
buildClassifierin interfaceweka.classifiers.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 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:
getMatrixNamesin 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:
getMatrixin 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:
hasLoadingsin interfaceGenericPLSMatrixAccess- Returns:
- true if supported
- See Also:
getLoadings()
-
getLoadings
public weka.core.matrix.Matrix getLoadings()
Returns the loadings, if available.- Specified by:
getLoadingsin 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:
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
-
-