Package weka.attributeSelection
Class AbstractPLSAttributeEval
- java.lang.Object
-
- weka.attributeSelection.ASEvaluation
-
- weka.attributeSelection.AbstractPLSAttributeEval
-
- All Implemented Interfaces:
Serializable
,weka.attributeSelection.AttributeEvaluator
,weka.core.CapabilitiesHandler
,weka.core.CapabilitiesIgnorer
,weka.core.CommandlineRunnable
,weka.core.OptionHandler
,weka.core.RevisionHandler
- Direct Known Subclasses:
PLS1AttributeEval
,SIMPLSAttributeEval
public abstract class AbstractPLSAttributeEval extends weka.attributeSelection.ASEvaluation implements weka.attributeSelection.AttributeEvaluator, weka.core.OptionHandler
Ancestor for PLS attribute evaluators- Author:
- Hisham Abdel Qader (habdelqa at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractPLSAttributeEval.LoadingsCalculations
-
Field Summary
Fields Modifier and Type Field Description protected adams.core.Range
m_ComponentRange
for user defined range of components used.protected AbstractPLSAttributeEval.LoadingsCalculations
m_LoadingsCalculations
for how to use the loadings.protected AbstractSingleClassPLS
m_Model
the underlying model.protected int
m_NumComponents
the number of components parameter.protected PreprocessingType
m_PreprocessingType
the preprocessing type to perform.protected double[]
m_Ranking
the determined attribute ranking.protected boolean
m_ReplaceMissing
the replace missing values parameter.
-
Constructor Summary
Constructors Constructor Description AbstractPLSAttributeEval()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
buildEvaluator(weka.core.Instances instances)
Generates a attribute evaluator.String
componentRangeTipText()
Returns the tip text for this propertydouble
evaluateAttribute(int i)
evaluates an individual attributeadams.core.Range
getComponentRange()
Returns the range of components to be used.AbstractPLSAttributeEval.LoadingsCalculations
getLoadingsCalculations()
returns the maximum number of attributes to use.int
getNumComponents()
returns the maximum number of attributes to use.String[]
getOptions()
Gets the current option settings for the OptionHandler.PreprocessingType
getPreprocessingType()
Returns the type of preprocessing to perform.boolean
getReplaceMissing()
Gets whether missing values are replaced.Enumeration<weka.core.Option>
listOptions()
Returns an enumeration of all the available options..String
loadingsCalculationsTipText()
Returns the tip text for this propertyprotected abstract AbstractSingleClassPLS
newModel()
Creates a new instance of a PLS algorrithm.String
numComponentsTipText()
Returns the tip text for this propertyString
preprocessingTypeTipText()
Returns the tip text for this propertyString
replaceMissingTipText()
Returns the tip text for this propertyvoid
setComponentRange(adams.core.Range value)
Sets the range of components to be used.void
setLoadingsCalculations(AbstractPLSAttributeEval.LoadingsCalculations value)
sets the maximum number of attributes to use.void
setNumComponents(int value)
sets the maximum number of attributes to use.void
setOptions(String[] options)
Sets the OptionHandler's options using the given list.void
setPreprocessingType(PreprocessingType value)
Sets the type of preprocessing to perform.void
setReplaceMissing(boolean value)
Sets whether to replace missing values.String
toString()
Outputs the underlying linear regression model.
-
-
-
Field Detail
-
m_Model
protected AbstractSingleClassPLS m_Model
the underlying model.
-
m_PreprocessingType
protected PreprocessingType m_PreprocessingType
the preprocessing type to perform.
-
m_ReplaceMissing
protected boolean m_ReplaceMissing
the replace missing values parameter.
-
m_NumComponents
protected int m_NumComponents
the number of components parameter.
-
m_LoadingsCalculations
protected AbstractPLSAttributeEval.LoadingsCalculations m_LoadingsCalculations
for how to use the loadings.
-
m_ComponentRange
protected adams.core.Range m_ComponentRange
for user defined range of components used.
-
m_Ranking
protected double[] m_Ranking
the determined attribute ranking.
-
-
Method Detail
-
listOptions
public Enumeration<weka.core.Option> listOptions()
Returns an enumeration of all the available options..- Specified by:
listOptions
in interfaceweka.core.OptionHandler
- Returns:
- an enumeration of all available options.
-
setOptions
public void setOptions(String[] options) throws Exception
Sets the OptionHandler's options using the given list. All options will be set (or reset) during this call (i.e. incremental setting of options is not possible).- Specified by:
setOptions
in interfaceweka.core.OptionHandler
- Parameters:
options
- the list of options as an array of strings- Throws:
Exception
- if an option is not supported
-
getOptions
public String[] getOptions()
Gets the current option settings for the OptionHandler.- Specified by:
getOptions
in interfaceweka.core.OptionHandler
- Returns:
- the list of current option settings as an array of strings
-
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 replaced.- 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
-
setComponentRange
public void setComponentRange(adams.core.Range value)
Sets the range of components to be used.- Parameters:
value
- the range
-
getComponentRange
public adams.core.Range getComponentRange()
Returns the range of components to be used.- Returns:
- the type
-
componentRangeTipText
public String componentRangeTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setLoadingsCalculations
public void setLoadingsCalculations(AbstractPLSAttributeEval.LoadingsCalculations value)
sets the maximum number of attributes to use.- Parameters:
value
- the maximum number of attributes
-
getLoadingsCalculations
public AbstractPLSAttributeEval.LoadingsCalculations getLoadingsCalculations()
returns the maximum number of attributes to use.- Returns:
- the current maximum number of attributes
-
loadingsCalculationsTipText
public String loadingsCalculationsTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
newModel
protected abstract AbstractSingleClassPLS newModel()
Creates a new instance of a PLS algorrithm.- Returns:
- the instance
-
buildEvaluator
public void buildEvaluator(weka.core.Instances instances) throws Exception
Generates a attribute evaluator. Has to initialize all fields of the evaluator that are not being set via options.- Specified by:
buildEvaluator
in classweka.attributeSelection.ASEvaluation
- Parameters:
instances
- set of instances serving as training data- Throws:
Exception
- if the evaluator has not been generated successfully
-
evaluateAttribute
public double evaluateAttribute(int i) throws Exception
evaluates an individual attribute- Specified by:
evaluateAttribute
in interfaceweka.attributeSelection.AttributeEvaluator
- Parameters:
i
- the index of the attribute to be evaluated- Returns:
- the "merit" of the attribute
- Throws:
Exception
- if the attribute could not be evaluated
-
-