|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.attributeSelection.AttributeSelection
public class AttributeSelection
Attribute selection class. Takes the name of a search class and an evaluation class on the command line.
Valid options are: -hpublic static void main(String [] args) { runEvaluator(new FunkyEvaluator(), args); }------------------------------------------------------------------------
Constructor Summary | |
---|---|
AttributeSelection()
constructor. |
Method Summary | |
---|---|
java.lang.String |
CrossValidateAttributes()
Perform a cross validation for attribute selection. |
java.lang.String |
CVResultsString()
returns a string summarizing the results of repeated attribute selection runs on splits of a dataset. |
static void |
main(java.lang.String[] args)
Main method for testing this class. |
int |
numberAttributesSelected()
Return the number of attributes selected from the most recent run of attribute selection |
double[][] |
rankedAttributes()
get the final ranking of the attributes. |
Instance |
reduceDimensionality(Instance in)
reduce the dimensionality of a single instance to include only those attributes chosen by the last run of attribute selection. |
Instances |
reduceDimensionality(Instances in)
reduce the dimensionality of a set of instances to include only those attributes chosen by the last run of attribute selection. |
static java.lang.String |
SelectAttributes(ASEvaluation ASEvaluator,
java.lang.String[] options)
Perform attribute selection with a particular evaluator and a set of options specifying search method and input file etc. |
static java.lang.String |
SelectAttributes(ASEvaluation ASEvaluator,
java.lang.String[] options,
Instances train)
Perform attribute selection with a particular evaluator and a set of options specifying search method and options for the search method and evaluator. |
void |
SelectAttributes(Instances data)
Perform attribute selection on the supplied training instances. |
void |
selectAttributesCVSplit(Instances split)
Select attributes for a split of the data. |
int[] |
selectedAttributes()
get the final selected set of attributes. |
void |
setEvaluator(ASEvaluation evaluator)
set the attribute/subset evaluator |
void |
setFolds(int folds)
set the number of folds for cross validation |
void |
setRanking(boolean r)
produce a ranking (if possible with the set search and evaluator) |
void |
setSearch(ASSearch search)
set the search method |
void |
setSeed(int s)
set the seed for use in cross validation |
void |
setXval(boolean x)
do a cross validation |
java.lang.String |
toResultsString()
get a description of the attribute selection |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AttributeSelection()
Method Detail |
---|
public int numberAttributesSelected() throws java.lang.Exception
java.lang.Exception
public int[] selectedAttributes() throws java.lang.Exception
java.lang.Exception
- if attribute selection has not been performed yetpublic double[][] rankedAttributes() throws java.lang.Exception
java.lang.Exception
- if a ranking has not been producedpublic void setEvaluator(ASEvaluation evaluator)
evaluator
- the evaluator to usepublic void setSearch(ASSearch search)
search
- the search method to usepublic void setFolds(int folds)
folds
- the number of foldspublic void setRanking(boolean r)
r
- true if a ranking is to be producedpublic void setXval(boolean x)
x
- true if a cross validation is to be performedpublic void setSeed(int s)
s
- the seedpublic java.lang.String toResultsString()
public Instances reduceDimensionality(Instances in) throws java.lang.Exception
in
- the instances to be reduced
java.lang.Exception
- if the instances can't be reducedpublic Instance reduceDimensionality(Instance in) throws java.lang.Exception
in
- the instance to be reduced
java.lang.Exception
- if the instance can't be reducedpublic static java.lang.String SelectAttributes(ASEvaluation ASEvaluator, java.lang.String[] options) throws java.lang.Exception
ASEvaluator
- an evaluator objectoptions
- an array of options, not only for the evaluator
but also the search method (if any) and an input data file
java.lang.Exception
- if no training file is setpublic java.lang.String CVResultsString() throws java.lang.Exception
java.lang.Exception
- if no attribute selection has been performed.public void selectAttributesCVSplit(Instances split) throws java.lang.Exception
split
- the instances to select attributes from
java.lang.Exception
- if an error occurspublic java.lang.String CrossValidateAttributes() throws java.lang.Exception
java.lang.Exception
- if an error occurs during cross validationpublic void SelectAttributes(Instances data) throws java.lang.Exception
data
- the instances to select attributes from
java.lang.Exception
- if there is a problem during selectionpublic static java.lang.String SelectAttributes(ASEvaluation ASEvaluator, java.lang.String[] options, Instances train) throws java.lang.Exception
ASEvaluator
- an evaluator objectoptions
- an array of options, not only for the evaluator
but also the search method (if any) and an input data filetrain
- the input instances
java.lang.Exception
- if incorrect options are suppliedpublic static void main(java.lang.String[] args)
args
- the options
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |