public class AttributeSelection extends Object implements Serializable, RevisionHandler
public static void main(String [] args) { runEvaluator(new FunkyEvaluator(), args); }------------------------------------------------------------------------
Constructor and Description |
---|
AttributeSelection()
constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
CrossValidateAttributes()
Perform a cross validation for attribute selection.
|
String |
CVResultsString()
returns a string summarizing the results of repeated attribute
selection runs on splits of a dataset.
|
String |
getRevision()
Returns the revision string.
|
static void |
main(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 String |
SelectAttributes(ASEvaluation ASEvaluator,
String[] options)
Perform attribute selection with a particular evaluator and
a set of options specifying search method and input file etc.
|
static String |
SelectAttributes(ASEvaluation ASEvaluator,
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
|
String |
toResultsString()
get a description of the attribute selection
|
public AttributeSelection()
public int numberAttributesSelected() throws Exception
Exception
public int[] selectedAttributes() throws Exception
Exception
- if attribute selection has not been performed yetpublic double[][] rankedAttributes() throws Exception
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 String toResultsString()
public Instances reduceDimensionality(Instances in) throws Exception
in
- the instances to be reducedException
- if the instances can't be reducedpublic Instance reduceDimensionality(Instance in) throws Exception
in
- the instance to be reducedException
- if the instance can't be reducedpublic static String SelectAttributes(ASEvaluation ASEvaluator, String[] options) throws 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 fileException
- if no training file is setpublic String CVResultsString() throws Exception
Exception
- if no attribute selection has been performed.public void selectAttributesCVSplit(Instances split) throws Exception
split
- the instances to select attributes fromException
- if an error occurspublic String CrossValidateAttributes() throws Exception
Exception
- if an error occurs during cross validationpublic void SelectAttributes(Instances data) throws Exception
data
- the instances to select attributes fromException
- if there is a problem during selectionpublic static String SelectAttributes(ASEvaluation ASEvaluator, String[] options, Instances train) throws 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 instancesException
- if incorrect options are suppliedpublic static void main(String[] args)
args
- the optionspublic String getRevision()
getRevision
in interface RevisionHandler
Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.