Package weka.attributeSelection
Class FilteredAttributeEval
- java.lang.Object
-
- weka.attributeSelection.ASEvaluation
-
- weka.attributeSelection.FilteredAttributeEval
-
- All Implemented Interfaces:
java.io.Serializable,AttributeEvaluator,CapabilitiesHandler,OptionHandler,RevisionHandler
public class FilteredAttributeEval extends ASEvaluation implements java.io.Serializable, AttributeEvaluator, OptionHandler
Class for running an arbitrary attribute evaluator on data that has been passed through an arbitrary filter (note: filters that alter the order or number of attributes are not allowed). Like the evaluator, the structure of the filter is based exclusively on the training data. Valid options are:-W <evaluator specification> Full name of base evaluator to use, followed by evaluator options. eg: "weka.attributeSelection.InfoGainAttributeEval -M"
-F <filter specification> Full class name of filter to use, followed by filter options. eg: "weka.filters.supervised.instance.SpreadSubsample -M 1"
- Version:
- $Revision: 5562 $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FilteredAttributeEval()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringattributeEvaluatorTipText()Returns the tip text for this propertyvoidbuildEvaluator(Instances data)Initializes a filtered attribute evaluator.doubleevaluateAttribute(int attribute)Evaluates an individual attribute by delegating to the base evaluator.java.lang.StringfilterTipText()Returns the tip text for this propertyASEvaluationgetAttributeEvaluator()Get the attribute evaluator to useCapabilitiesgetCapabilities()Returns default capabilities of the evaluator.FiltergetFilter()Get the filter to usejava.lang.String[]getOptions()Gets the current settings of the subset evaluator.java.lang.StringgetRevision()Returns the revision string.java.lang.StringglobalInfo()java.util.EnumerationlistOptions()Returns an enumeration describing the available options.static voidmain(java.lang.String[] args)Main method for testing this class.voidsetAttributeEvaluator(ASEvaluation newEvaluator)Set the attribute evaluator to usevoidsetFilter(Filter newFilter)Set the filter to usevoidsetOptions(java.lang.String[] options)Parses a given list of options.java.lang.StringtoString()Describe the attribute evaluator-
Methods inherited from class weka.attributeSelection.ASEvaluation
clean, forName, makeCopies, postProcess
-
-
-
-
Method Detail
-
getCapabilities
public Capabilities getCapabilities()
Returns default capabilities of the evaluator.- Specified by:
getCapabilitiesin interfaceCapabilitiesHandler- Overrides:
getCapabilitiesin classASEvaluation- Returns:
- the capabilities of this evaluator.
- See Also:
Capabilities
-
globalInfo
public java.lang.String globalInfo()
- Returns:
- a description of the evaluator suitable for displaying in the explorer/experimenter gui
-
listOptions
public java.util.Enumeration listOptions()
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Returns:
- an enumeration of all the available options.
-
setOptions
public void setOptions(java.lang.String[] options) throws java.lang.ExceptionParses a given list of options. Valid options are:-W <evaluator specification> Full name of base evaluator to use, followed by evaluator options. eg: "weka.attributeSelection.InfoGainAttributeEval -M"
-F <filter specification> Full class name of filter to use, followed by filter options. eg: "weka.filters.supervised.instance.SpreadSubsample -M 1"
- Specified by:
setOptionsin interfaceOptionHandler- Parameters:
options- the list of options as an array of strings- Throws:
java.lang.Exception- if an option is not supported
-
getOptions
public java.lang.String[] getOptions()
Gets the current settings of the subset evaluator.- Specified by:
getOptionsin interfaceOptionHandler- Returns:
- an array of strings suitable for passing to setOptions
-
attributeEvaluatorTipText
public java.lang.String attributeEvaluatorTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setAttributeEvaluator
public void setAttributeEvaluator(ASEvaluation newEvaluator)
Set the attribute evaluator to use- Parameters:
newEvaluator- the attribute evaluator to use
-
getAttributeEvaluator
public ASEvaluation getAttributeEvaluator()
Get the attribute evaluator to use- Returns:
- the attribute evaluator to use
-
filterTipText
public java.lang.String filterTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setFilter
public void setFilter(Filter newFilter)
Set the filter to use- Parameters:
newFilter- the filter to use
-
getFilter
public Filter getFilter()
Get the filter to use- Returns:
- the filter to use
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Overrides:
getRevisionin classASEvaluation- Returns:
- the revision
-
buildEvaluator
public void buildEvaluator(Instances data) throws java.lang.Exception
Initializes a filtered attribute evaluator.- Specified by:
buildEvaluatorin classASEvaluation- Parameters:
data- set of instances serving as training data- Throws:
java.lang.Exception- if the evaluator has not been generated successfully
-
evaluateAttribute
public double evaluateAttribute(int attribute) throws java.lang.ExceptionEvaluates an individual attribute by delegating to the base evaluator.- Specified by:
evaluateAttributein interfaceAttributeEvaluator- Parameters:
attribute- the index of the attribute to be evaluated- Returns:
- the merit of the attribute according to the base evaluator
- Throws:
java.lang.Exception- if the attribute could not be evaluated
-
toString
public java.lang.String toString()
Describe the attribute evaluator- Overrides:
toStringin classjava.lang.Object- Returns:
- a description of the attribute evaluator as a string
-
main
public static void main(java.lang.String[] args)
Main method for testing this class.- Parameters:
args- the options
-
-