public class AttributeSelection extends Filter implements SupervisedFilter, OptionHandler, WeightedAttributesHandler, WeightedInstancesHandler
-S <"Name of search class [search options]"> Sets search method for subset evaluators. eg. -S "weka.attributeSelection.BestFirst -S 8"
-E <"Name of attribute/subset evaluation class [evaluator options]"> Sets attribute/subset evaluator. eg. -E "weka.attributeSelection.CfsSubsetEval -L"
Options specific to evaluator weka.attributeSelection.CfsSubsetEval:
-M Treat missing values as a seperate value.
-L Don't include locally predictive attributes.
Options specific to search weka.attributeSelection.BestFirst:
-P <start set> Specify a starting set of attributes. Eg. 1,3,5-7.
-D <0 = backward | 1 = forward | 2 = bi-directional> Direction of search. (default = 1).
-N <num> Number of non-improving nodes to consider before terminating search.
-S <num> Size of lookup cache for evaluated subsets. Expressed as a multiple of the number of attributes in the data set. (default = 1)
Constructor and Description |
---|
AttributeSelection()
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
batchFinished()
Signify that this batch of input to the filter is finished.
|
java.lang.String |
evaluatorTipText()
Returns the tip text for this property
|
Capabilities |
getCapabilities()
Returns the Capabilities of this filter.
|
ASEvaluation |
getEvaluator()
Get the name of the attribute/subset evaluator
|
java.lang.String[] |
getOptions()
Gets the current settings for the attribute selection (search, evaluator)
etc.
|
java.lang.String |
getRevision()
Returns the revision string.
|
ASSearch |
getSearch()
Get the name of the search method
|
java.lang.String |
globalInfo()
Returns a string describing this filter
|
boolean |
input(Instance instance)
Input an instance for filtering.
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
java.lang.String |
searchTipText()
Returns the tip text for this property
|
void |
setEvaluator(ASEvaluation evaluator)
set attribute/subset evaluator
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setSearch(ASSearch search)
Set search class
|
batchFilterFile, debugTipText, doNotCheckCapabilitiesTipText, filterFile, getCapabilities, getCopyOfInputFormat, getDebug, getDoNotCheckCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, postExecution, preExecution, run, runFilter, setDebug, setDoNotCheckCapabilities, setInputFormat, toString, useFilter, wekaStaticWrapper
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public java.lang.String globalInfo()
public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class Filter
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-S <"Name of search class [search options]"> Sets search method for subset evaluators. eg. -S "weka.attributeSelection.BestFirst -S 8"
-E <"Name of attribute/subset evaluation class [evaluator options]"> Sets attribute/subset evaluator. eg. -E "weka.attributeSelection.CfsSubsetEval -L"
Options specific to evaluator weka.attributeSelection.CfsSubsetEval:
-M Treat missing values as a seperate value.
-L Don't include locally predictive attributes.
Options specific to search weka.attributeSelection.BestFirst:
-P <start set> Specify a starting set of attributes. Eg. 1,3,5-7.
-D <0 = backward | 1 = forward | 2 = bi-directional> Direction of search. (default = 1).
-N <num> Number of non-improving nodes to consider before terminating search.
-S <num> Size of lookup cache for evaluated subsets. Expressed as a multiple of the number of attributes in the data set. (default = 1)
setOptions
in interface OptionHandler
setOptions
in class Filter
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class Filter
public java.lang.String evaluatorTipText()
public void setEvaluator(ASEvaluation evaluator)
evaluator
- the evaluator to usepublic java.lang.String searchTipText()
public void setSearch(ASSearch search)
search
- the search class to usepublic ASEvaluation getEvaluator()
public ASSearch getSearch()
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Filter
Capabilities
public boolean input(Instance instance) throws java.lang.Exception
input
in class Filter
instance
- the input instancejava.lang.IllegalStateException
- if no input format has been defined.java.lang.Exception
- if the input instance was not of the correct format or if
there was a problem with the filtering.public boolean batchFinished() throws java.lang.Exception
batchFinished
in class Filter
java.lang.IllegalStateException
- if no input structure has been defined.java.lang.Exception
- if there is a problem during the attribute selection.public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Filter
public static void main(java.lang.String[] argv)
argv
- should contain arguments to the filter: use -h for help