Package adams.data.instancesanalysis.pls
Class AbstractPLS
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.instancesanalysis.pls.AbstractPLS
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.SizeOfHandler
,adams.core.TechnicalInformationHandler
,Serializable
,weka.core.CapabilitiesHandler
,GenericPLSMatrixAccess
- Direct Known Subclasses:
AbstractMultiClassPLS
,AbstractSingleClassPLS
public abstract class AbstractPLS extends adams.core.option.AbstractOptionHandler implements weka.core.CapabilitiesHandler, adams.core.TechnicalInformationHandler, GenericPLSMatrixAccess
Ancestor for PLS implementations.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_Initialized
whether the scheme has been initialized.protected int
m_NumComponents
the maximum number of components to generateprotected weka.core.Instances
m_OutputFormat
the output format.protected PredictionType
m_PredictionType
the prediction type to perform.protected PreprocessingType
m_PreprocessingType
the preprocessing type to perform.protected boolean
m_ReplaceMissing
whether to replace missing values
-
Constructor Summary
Constructors Constructor Description AbstractPLS()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.abstract weka.core.Instances
determineOutputFormat(weka.core.Instances input)
Determines the output format based on the input format and returns this.protected abstract weka.core.Instances
doTransform(weka.core.Instances data, Map<String,Object> params)
Transforms the data, initializes if necessary.weka.core.Capabilities
getCapabilities()
Returns the Capabilities of this filter.protected PreprocessingType
getDefaultPreprocessingType()
Returns the default preprocessing type.abstract weka.core.matrix.Matrix
getLoadings()
Returns the loadings, if available.abstract weka.core.matrix.Matrix
getMatrix(String name)
Returns the matrix with the specified name.abstract String[]
getMatrixNames()
Returns the all the available matrices.int
getNumComponents()
returns the maximum number of attributes to use.weka.core.Instances
getOutputFormat()
Returns the output format.PredictionType
getPredictionType()
Returns the type of prediction to perform.PreprocessingType
getPreprocessingType()
Returns the type of preprocessing to perform.boolean
getReplaceMissing()
Gets whether missing values are replace.abstract adams.core.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.abstract boolean
hasLoadings()
Whether the algorithm supports return of loadings.boolean
isInitialized()
Returns whether the scheme has been initialized.String
numComponentsTipText()
Returns the tip text for this propertyprotected abstract weka.core.Instances
postTransform(weka.core.Instances instances, Map<String,Object> params)
Postprocesses the data.String
predictionTypeTipText()
Returns the tip text for this propertyString
preprocessingTypeTipText()
Returns the tip text for this propertyprotected abstract weka.core.Instances
preTransform(weka.core.Instances instances, Map<String,Object> params)
Preprocesses the data.String
replaceMissingTipText()
Returns the tip text for this propertyvoid
reset()
Resets the scheme.void
setNumComponents(int value)
sets the maximum number of attributes to use.void
setPredictionType(PredictionType value)
Sets the type of prediction to perform.void
setPreprocessingType(PreprocessingType value)
Sets the type of preprocessing to perform.void
setReplaceMissing(boolean value)
Sets whether to replace missing values.weka.core.Instances
transform(weka.core.Instances data)
Transforms the data, initializes if necessary.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Initialized
protected boolean m_Initialized
whether the scheme has been initialized.
-
m_PreprocessingType
protected PreprocessingType m_PreprocessingType
the preprocessing type to perform.
-
m_ReplaceMissing
protected boolean m_ReplaceMissing
whether to replace missing values
-
m_NumComponents
protected int m_NumComponents
the maximum number of components to generate
-
m_PredictionType
protected PredictionType m_PredictionType
the prediction type to perform.
-
m_OutputFormat
protected weka.core.Instances m_OutputFormat
the output format.
-
-
Method Detail
-
getTechnicalInformation
public abstract adams.core.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:
getTechnicalInformation
in interfaceadams.core.TechnicalInformationHandler
- Returns:
- the technical information about this class
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
getDefaultPreprocessingType
protected PreprocessingType getDefaultPreprocessingType()
Returns the default preprocessing type.- Returns:
- the default
-
setPreprocessingType
public void setPreprocessingType(PreprocessingType value)
Sets the type of preprocessing to perform.- Parameters:
value
- the type
-
getPreprocessingType
public PreprocessingType getPreprocessingType()
Returns the type of preprocessing to perform.- Returns:
- the type
-
preprocessingTypeTipText
public String preprocessingTypeTipText()
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
-
replaceMissingTipText
public String replaceMissingTipText()
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
-
numComponentsTipText
public String numComponentsTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setPredictionType
public void setPredictionType(PredictionType value)
Sets the type of prediction to perform. Calling this method does not result in areset()
call.- Parameters:
value
- the type
-
getPredictionType
public PredictionType getPredictionType()
Returns the type of prediction to perform.- Returns:
- the type
-
predictionTypeTipText
public String predictionTypeTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
reset
public void reset()
Resets the scheme.- Overrides:
reset
in classadams.core.option.AbstractOptionHandler
-
getCapabilities
public weka.core.Capabilities getCapabilities()
Returns the Capabilities of this filter.- Specified by:
getCapabilities
in interfaceweka.core.CapabilitiesHandler
- Returns:
- the capabilities of this object
- See Also:
Capabilities
-
getMatrixNames
public abstract String[] getMatrixNames()
Returns the all the available matrices.- Specified by:
getMatrixNames
in interfaceGenericPLSMatrixAccess
- Returns:
- the names of the matrices
-
getMatrix
public abstract 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 abstract boolean hasLoadings()
Whether the algorithm supports return of loadings.- Specified by:
hasLoadings
in interfaceGenericPLSMatrixAccess
- Returns:
- true if supported
- See Also:
getLoadings()
-
getLoadings
public abstract weka.core.matrix.Matrix getLoadings()
Returns the loadings, if available.- Specified by:
getLoadings
in interfaceGenericPLSMatrixAccess
- Returns:
- the loadings, null if not available
-
isInitialized
public boolean isInitialized()
Returns whether the scheme has been initialized.- Returns:
- true if initialized
-
determineOutputFormat
public abstract weka.core.Instances determineOutputFormat(weka.core.Instances input) throws Exception
Determines the output format based on the input format and returns this.- Parameters:
input
- the input format to base the output format on- Returns:
- the output format
- Throws:
Exception
- in case the determination goes wrong
-
getOutputFormat
public weka.core.Instances getOutputFormat()
Returns the output format.- Returns:
- the output format
-
preTransform
protected abstract weka.core.Instances preTransform(weka.core.Instances instances, Map<String,Object> params) throws Exception
Preprocesses the data.- Parameters:
instances
- the data to processparams
- additional parameters- Returns:
- the preprocessed data
- Throws:
Exception
-
doTransform
protected abstract weka.core.Instances doTransform(weka.core.Instances data, Map<String,Object> params) throws Exception
Transforms the data, initializes if necessary.- Parameters:
data
- the data to useparams
- additional parameters- Returns:
- the transformed data
- Throws:
Exception
-
postTransform
protected abstract weka.core.Instances postTransform(weka.core.Instances instances, Map<String,Object> params) throws Exception
Postprocesses the data.- Parameters:
instances
- the data to processparams
- additional parameters- Returns:
- the postprocessed data
- Throws:
Exception
-
-