Class PLSFilterExtended
- java.lang.Object
-
- weka.filters.Filter
-
- weka.filters.SimpleFilter
-
- weka.filters.SimpleBatchFilter
-
- weka.filters.supervised.attribute.PLSFilter
-
- weka.filters.supervised.attribute.PLSFilterExtended
-
- All Implemented Interfaces:
Serializable
,weka.core.CapabilitiesHandler
,weka.core.CapabilitiesIgnorer
,weka.core.CommandlineRunnable
,weka.core.OptionHandler
,weka.core.RevisionHandler
,weka.core.TechnicalInformationHandler
,weka.filters.SupervisedFilter
public class PLSFilterExtended extends weka.filters.supervised.attribute.PLSFilter
Class contains changes to the Weka's PLSFilter in order to have simpls work with multiple y attributes. * @author Cor Lieftink (c.lieftink at nki dot nl)- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected double[]
m_Means
protected double[]
m_StdDevs
-
Fields inherited from class weka.filters.supervised.attribute.PLSFilter
ALGORITHM_PLS1, ALGORITHM_SIMPLS, m_Algorithm, m_ClassMean, m_ClassStdDev, m_Filter, m_Missing, m_NumComponents, m_PerformPrediction, m_PLS1_b_hat, m_PLS1_P, m_PLS1_RegVector, m_PLS1_W, m_Preprocessing, m_ReplaceMissing, m_SIMPLS_B, m_SIMPLS_W, PREPROCESSING_CENTER, PREPROCESSING_NONE, PREPROCESSING_STANDARDIZE, TAGS_ALGORITHM, TAGS_PREPROCESSING
-
-
Constructor Summary
Constructors Constructor Description PLSFilterExtended()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected weka.core.Instances
determineOutputFormat(weka.core.Instances inputFormat)
Override original, in order to put more than one class attribute to the output format.weka.core.matrix.Matrix
getbHat()
weka.core.matrix.Matrix
getRegVector()
weka.core.matrix.Matrix
getX(weka.core.Instances instances)
Override superclass method in order to deal with multiple yweka.core.matrix.Matrix
getxWeights()
weka.core.matrix.Matrix
getY(weka.core.Instances instances)
Override superclass method in order to deal with multiple ydouble[]
means()
the mean of all the attributesprotected weka.core.Instances
process(weka.core.Instances instances)
Override in order to have the destandardized predictions for multiple y added.protected weka.core.Instances
processSIMPLS(weka.core.Instances instances)
Extended superclass method for increasing dimensions and/of changing handling of the Matrices C,W,P,Q to deal with multiple Y variables.double[]
stdDevs()
the standard deviation of the classprotected weka.core.Instances
toInstances(weka.core.Instances header, weka.core.matrix.Matrix x, weka.core.matrix.Matrix y)
Override superclass method, as this cannot deal with multiple y attributes Returns the X and Y matrix again as Instances object, based on the given header (must have a class attribute set).-
Methods inherited from class weka.filters.supervised.attribute.PLSFilter
algorithmTipText, columnAsVector, getAlgorithm, getCapabilities, getDominantEigenVector, getNumComponents, getOptions, getPerformPrediction, getPreprocessing, getReplaceMissing, getRevision, getTechnicalInformation, getVector, getX, getY, globalInfo, listOptions, main, normalizeVector, numComponentsTipText, performPredictionTipText, preprocessingTipText, processPLS1, replaceMissingTipText, setAlgorithm, setNumComponents, setOptions, setPerformPrediction, setPreprocessing, setReplaceMissing, setVector
-
Methods inherited from class weka.filters.SimpleBatchFilter
allowAccessToFullInputFormat, batchFinished, hasImmediateOutputFormat, input
-
Methods inherited from class weka.filters.Filter
batchFilterFile, bufferInput, copyValues, copyValues, debugTipText, doNotCheckCapabilitiesTipText, filterFile, flushInput, getCapabilities, getDebug, getDoNotCheckCapabilities, getInputFormat, getOutputFormat, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputFormatPeek, outputPeek, postExecution, preExecution, push, push, resetQueue, run, runFilter, setDebug, setDoNotCheckCapabilities, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapper
-
-
-
-
Method Detail
-
getxWeights
public weka.core.matrix.Matrix getxWeights()
-
getX
public weka.core.matrix.Matrix getX(weka.core.Instances instances)
Override superclass method in order to deal with multiple y- Overrides:
getX
in classweka.filters.supervised.attribute.PLSFilter
- Parameters:
instances
- the data to work on- Returns:
- the x attributes
-
getY
public weka.core.matrix.Matrix getY(weka.core.Instances instances)
Override superclass method in order to deal with multiple y- Overrides:
getY
in classweka.filters.supervised.attribute.PLSFilter
- Parameters:
instances
- the data to work on- Returns:
- the y attributes
-
getbHat
public weka.core.matrix.Matrix getbHat()
-
getRegVector
public weka.core.matrix.Matrix getRegVector()
-
means
public double[] means()
the mean of all the attributes
-
stdDevs
public double[] stdDevs()
the standard deviation of the class
-
determineOutputFormat
protected weka.core.Instances determineOutputFormat(weka.core.Instances inputFormat) throws Exception
Override original, in order to put more than one class attribute to the output format. Determines the output format based on the input format and returns this. In case the output format cannot be returned immediately, i.e., immediateOutputFormat() returns false, then this method will be called from batchFinished().- Overrides:
determineOutputFormat
in classweka.filters.supervised.attribute.PLSFilter
- Parameters:
inputFormat
- the input format to base the output format on- Returns:
- the output format
- Throws:
Exception
- in case the determination goes wrong- See Also:
SimpleBatchFilter.hasImmediateOutputFormat()
,SimpleBatchFilter.batchFinished()
-
toInstances
protected weka.core.Instances toInstances(weka.core.Instances header, weka.core.matrix.Matrix x, weka.core.matrix.Matrix y)
Override superclass method, as this cannot deal with multiple y attributes Returns the X and Y matrix again as Instances object, based on the given header (must have a class attribute set).- Overrides:
toInstances
in classweka.filters.supervised.attribute.PLSFilter
- Parameters:
header
- the format of the instance objectx
- the X matrix (data)y
- the Y matrix (class)- Returns:
- the assembled data
-
process
protected weka.core.Instances process(weka.core.Instances instances) throws Exception
Override in order to have the destandardized predictions for multiple y added. Processes the given data (may change the provided dataset) and returns the modified version. This method is called in batchFinished().- Overrides:
process
in classweka.filters.supervised.attribute.PLSFilter
- Parameters:
instances
- the data to process- Returns:
- the modified data
- Throws:
Exception
- in case the processing goes wrong- See Also:
SimpleBatchFilter.batchFinished()
-
processSIMPLS
protected weka.core.Instances processSIMPLS(weka.core.Instances instances) throws Exception
Extended superclass method for increasing dimensions and/of changing handling of the Matrices C,W,P,Q to deal with multiple Y variables. processes the instances using the SIMPLS algorithm- Overrides:
processSIMPLS
in classweka.filters.supervised.attribute.PLSFilter
- Parameters:
instances
- the data to process- Returns:
- the modified data
- Throws:
Exception
- in case the processing goes wrong
-
-