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.OptionHandlerAncestor 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 classAbstractPLSAttributeEval.LoadingsCalculations
-
Field Summary
Fields Modifier and Type Field Description protected adams.core.Rangem_ComponentRangefor user defined range of components used.protected AbstractPLSAttributeEval.LoadingsCalculationsm_LoadingsCalculationsfor how to use the loadings.protected AbstractSingleClassPLSm_Modelthe underlying model.protected intm_NumComponentsthe number of components parameter.protected PreprocessingTypem_PreprocessingTypethe preprocessing type to perform.protected double[]m_Rankingthe determined attribute ranking.protected booleanm_ReplaceMissingthe 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 voidbuildEvaluator(weka.core.Instances instances)Generates a attribute evaluator.StringcomponentRangeTipText()Returns the tip text for this propertydoubleevaluateAttribute(int i)evaluates an individual attributeadams.core.RangegetComponentRange()Returns the range of components to be used.AbstractPLSAttributeEval.LoadingsCalculationsgetLoadingsCalculations()returns the maximum number of attributes to use.intgetNumComponents()returns the maximum number of attributes to use.String[]getOptions()Gets the current option settings for the OptionHandler.PreprocessingTypegetPreprocessingType()Returns the type of preprocessing to perform.booleangetReplaceMissing()Gets whether missing values are replaced.Enumeration<weka.core.Option>listOptions()Returns an enumeration of all the available options..StringloadingsCalculationsTipText()Returns the tip text for this propertyprotected abstract AbstractSingleClassPLSnewModel()Creates a new instance of a PLS algorrithm.StringnumComponentsTipText()Returns the tip text for this propertyStringpreprocessingTypeTipText()Returns the tip text for this propertyStringreplaceMissingTipText()Returns the tip text for this propertyvoidsetComponentRange(adams.core.Range value)Sets the range of components to be used.voidsetLoadingsCalculations(AbstractPLSAttributeEval.LoadingsCalculations value)sets the maximum number of attributes to use.voidsetNumComponents(int value)sets the maximum number of attributes to use.voidsetOptions(String[] options)Sets the OptionHandler's options using the given list.voidsetPreprocessingType(PreprocessingType value)Sets the type of preprocessing to perform.voidsetReplaceMissing(boolean value)Sets whether to replace missing values.StringtoString()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:
listOptionsin 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:
setOptionsin 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:
getOptionsin 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 ExceptionGenerates a attribute evaluator. Has to initialize all fields of the evaluator that are not being set via options.- Specified by:
buildEvaluatorin 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 Exceptionevaluates an individual attribute- Specified by:
evaluateAttributein 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
-
-