Package weka.attributeSelection
Class ASEvaluation
java.lang.Object
weka.attributeSelection.ASEvaluation
- All Implemented Interfaces:
Serializable,CapabilitiesHandler,CapabilitiesIgnorer,CommandlineRunnable,OptionHandler,RevisionHandler
- Direct Known Subclasses:
AttributeSetEvaluator,CfsSubsetEval,ClassifierAttributeEval,CorrelationAttributeEval,GainRatioAttributeEval,HoldOutSubsetEvaluator,InfoGainAttributeEval,OneRAttributeEval,ReliefFAttributeEval,SymmetricalUncertAttributeEval,UnsupervisedAttributeEvaluator,UnsupervisedSubsetEvaluator,WrapperSubsetEval
public abstract class ASEvaluation
extends Object
implements Serializable, CapabilitiesHandler, CapabilitiesIgnorer, RevisionHandler, CommandlineRunnable, OptionHandler
Abstract attribute selection evaluation class
- Version:
- $Revision: 15520 $
- Author:
- Mark Hall (mhall@cs.waikato.ac.nz)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidbuildEvaluator(Instances data) Generates a attribute evaluator.voidclean()Tells the evaluator that the attribute selection process is complete.Returns the tip text for this propertystatic ASEvaluationCreates a new instance of an attribute/subset evaluator given it's class name and (optional) arguments to pass to it's setOptions method.Returns the capabilities of this evaluator.booleanGet whether capabilities checking is turned off.String[]Gets the current settings of the evaluator.Returns the revision string.Returns an enumeration describing the available options.static ASEvaluation[]makeCopies(ASEvaluation model, int num) Creates copies of the current evaluator.voidPerform any teardown stuff that might need to happen after execution.int[]postProcess(int[] attributeSet) Provides a chance for a attribute evaluator to do any special post processing of the selected attribute set.voidPerform any setup stuff that might need to happen before commandline execution.voidExecute the supplied object.static voidrunEvaluator(ASEvaluation evaluator, String[] options) runs the evaluator with the given commandline optionsvoidsetDoNotCheckCapabilities(boolean doNotCheckCapabilities) Set whether not to check capabilities.voidsetOptions(String[] options) Parses a given list of options.
-
Constructor Details
-
ASEvaluation
public ASEvaluation()
-
-
Method Details
-
doNotCheckCapabilitiesTipText
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setDoNotCheckCapabilities
public void setDoNotCheckCapabilities(boolean doNotCheckCapabilities) Set whether not to check capabilities.- Specified by:
setDoNotCheckCapabilitiesin interfaceCapabilitiesIgnorer- Parameters:
doNotCheckCapabilities- true if capabilities are not to be checked.
-
getDoNotCheckCapabilities
public boolean getDoNotCheckCapabilities()Get whether capabilities checking is turned off.- Specified by:
getDoNotCheckCapabilitiesin interfaceCapabilitiesIgnorer- Returns:
- true if capabilities checking is turned off.
-
listOptions
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Returns:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options.- Specified by:
setOptionsin interfaceOptionHandler- Parameters:
options- the list of options as an array of strings- Throws:
Exception- if an option is not supported
-
getOptions
Gets the current settings of the evaluator.- Specified by:
getOptionsin interfaceOptionHandler- Returns:
- an array of strings suitable for passing to setOptions
-
buildEvaluator
Generates a attribute evaluator. Has to initialize all fields of the evaluator that are not being set via options.- Parameters:
data- set of instances serving as training data- Throws:
Exception- if the evaluator has not been generated successfully
-
postProcess
Provides a chance for a attribute evaluator to do any special post processing of the selected attribute set. Can also be used to clean up any data structures post attribute selection.- Parameters:
attributeSet- the set of attributes found by the search- Returns:
- a possibly ranked list of postprocessed attributes
- Throws:
Exception- if postprocessing fails for some reason
-
forName
Creates a new instance of an attribute/subset evaluator given it's class name and (optional) arguments to pass to it's setOptions method. If the evaluator implements OptionHandler and the options parameter is non-null, the evaluator will have it's options set.- Parameters:
evaluatorName- the fully qualified class name of the evaluatoroptions- an array of options suitable for passing to setOptions. May be null.- Returns:
- the newly created evaluator, ready for use.
- Throws:
Exception- if the evaluator name is invalid, or the options supplied are not acceptable to the evaluator
-
makeCopies
Creates copies of the current evaluator. Note that this method now uses Serialization to perform a deep copy, so the evaluator object must be fully Serializable. Any currently built model will now be copied as well.- Parameters:
model- an example evaluator to copynum- the number of evaluator copies to create.- Returns:
- an array of evaluators.
- Throws:
Exception- if an error occurs
-
getCapabilities
Returns the capabilities of this evaluator.- Specified by:
getCapabilitiesin interfaceCapabilitiesHandler- Returns:
- the capabilities of this evaluator
- See Also:
-
getRevision
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-
clean
public void clean()Tells the evaluator that the attribute selection process is complete. It can then clean up data structures, references to training data as necessary in order to save memory -
runEvaluator
runs the evaluator with the given commandline options- Parameters:
evaluator- the evaluator to runoptions- the commandline options
-
preExecution
Perform any setup stuff that might need to happen before commandline execution. Subclasses should override if they need to do something here- Specified by:
preExecutionin interfaceCommandlineRunnable- Throws:
Exception- if a problem occurs during setup
-
run
Execute the supplied object. Subclasses need to override this method.- Specified by:
runin interfaceCommandlineRunnable- Parameters:
toRun- the object to executeoptions- any options to pass to the object- Throws:
Exception- if a problem occurs
-
postExecution
Perform any teardown stuff that might need to happen after execution. Subclasses should override if they need to do something here- Specified by:
postExecutionin interfaceCommandlineRunnable- Throws:
Exception- if a problem occurs during teardown
-