public class WrapperSubsetEval extends ASEvaluation implements SubsetEvaluator, OptionHandler, TechnicalInformationHandler
Ron Kohavi, George H. John (1997). Wrappers for feature subset selection. Artificial Intelligence. 97(1-2):273-324.
BibTeX:@article{Kohavi1997, author = {Ron Kohavi and George H. John}, journal = {Artificial Intelligence}, note = {Special issue on relevance}, number = {1-2}, pages = {273-324}, title = {Wrappers for feature subset selection}, volume = {97}, year = {1997}, ISSN = {0004-3702} }
Valid options are:
-B <base learner> class name of base learner to use for accuracy estimation. Place any classifier options LAST on the command line following a "--". eg.: -B weka.classifiers.bayes.NaiveBayes ... -- -K (default: weka.classifiers.rules.ZeroR)
-F <num> number of cross validation folds to use for estimating accuracy. (default=5)
-R <seed> Seed for cross validation accuracy testimation. (default = 1)
-T <num> threshold by which to execute another cross validation (standard deviation---expressed as a percentage of the mean). (default: 0.01 (1%))
-E <acc | rmse | mae | f-meas | auc | auprc> Performance evaluation measure to use for selecting attributes. (Default = accuracy for discrete class and rmse for numeric class)
-IRclass <label | index> Optional class value (label or 1-based index) to use in conjunction with IR statistics (f-meas, auc or auprc). Omitting this option will use the class-weighted average.
Options specific to scheme weka.classifiers.rules.ZeroR:
-D If set, classifier is run in debug mode and may output additional info to the console
Modifier and Type | Field and Description |
---|---|
static int |
EVAL_ACCURACY |
static int |
EVAL_AUC |
static int |
EVAL_AUPRC |
static int |
EVAL_CORRELATION |
static int |
EVAL_DEFAULT |
static int |
EVAL_FMEASURE |
static int |
EVAL_MAE |
static int |
EVAL_PLUGIN |
static int |
EVAL_RMSE |
static Tag[] |
TAGS_EVALUATION
Holds all tags for metrics
|
Constructor and Description |
---|
WrapperSubsetEval()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
buildEvaluator(Instances data)
Generates a attribute evaluator.
|
java.lang.String |
classifierTipText()
Returns the tip text for this property
|
void |
clean()
Tells the evaluator that the attribute selection process is complete.
|
double |
evaluateSubset(java.util.BitSet subset)
Evaluates a subset of attributes
|
java.lang.String |
evaluationMeasureTipText()
Returns the tip text for this property
|
java.lang.String |
foldsTipText()
Returns the tip text for this property
|
Capabilities |
getCapabilities()
Returns the capabilities of this evaluator.
|
Classifier |
getClassifier()
Get the classifier used as the base learner.
|
SelectedTag |
getEvaluationMeasure()
Gets the currently set performance evaluation measure used for selecting
attributes for the decision table
|
int |
getFolds()
Get the number of folds used for accuracy estimation
|
java.lang.String |
getIRClassValue()
Get the class value (label or index) to use with IR metric evaluation of
subsets.
|
java.lang.String[] |
getOptions()
Gets the current settings of WrapperSubsetEval.
|
java.lang.String |
getRevision()
Returns the revision string.
|
int |
getSeed()
Get the random number seed used for cross validation
|
TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed
information about the technical background of this class, e.g., paper
reference or book this class is based on.
|
double |
getThreshold()
Get the value of the threshold
|
java.lang.String |
globalInfo()
Returns a string describing this attribute evaluator
|
java.lang.String |
IRClassValueTipText()
Returns the tip text for this property
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] args)
Main method for testing this class.
|
java.lang.String |
seedTipText()
Returns the tip text for this property
|
void |
setClassifier(Classifier newClassifier)
Set the classifier to use for accuracy estimation
|
void |
setEvaluationMeasure(SelectedTag newMethod)
Sets the performance evaluation measure to use for selecting attributes for
the decision table
|
void |
setFolds(int f)
Set the number of folds to use for accuracy estimation
|
void |
setIRClassValue(java.lang.String val)
Set the class value (label or index) to use with IR metric evaluation of
subsets.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setSeed(int s)
Set the seed to use for cross validation
|
void |
setThreshold(double t)
Set the value of the threshold for repeating cross validation
|
java.lang.String |
thresholdTipText()
Returns the tip text for this property
|
java.lang.String |
toString()
Returns a string describing the wrapper
|
doNotCheckCapabilitiesTipText, forName, getDoNotCheckCapabilities, makeCopies, postExecution, postProcess, preExecution, run, runEvaluator, setDoNotCheckCapabilities
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public static final int EVAL_DEFAULT
public static final int EVAL_ACCURACY
public static final int EVAL_RMSE
public static final int EVAL_MAE
public static final int EVAL_FMEASURE
public static final int EVAL_AUC
public static final int EVAL_AUPRC
public static final int EVAL_CORRELATION
public static final int EVAL_PLUGIN
public static final Tag[] TAGS_EVALUATION
public WrapperSubsetEval()
public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class ASEvaluation
public void setOptions(java.lang.String[] options) throws java.lang.Exception
Parses a given list of options.
Valid options are:-B <base learner> class name of base learner to use for accuracy estimation. Place any classifier options LAST on the command line following a "--". eg.: -B weka.classifiers.bayes.NaiveBayes ... -- -K (default: weka.classifiers.rules.ZeroR)
-F <num> number of cross validation folds to use for estimating accuracy. (default=5)
-R <seed> Seed for cross validation accuracy testimation. (default = 1)
-T <num> threshold by which to execute another cross validation (standard deviation---expressed as a percentage of the mean). (default: 0.01 (1%))
-E <acc | rmse | mae | f-meas | auc | auprc> Performance evaluation measure to use for selecting attributes. (Default = accuracy for discrete class and rmse for numeric class)
-IRclass <label | index> Optional class value (label or 1-based index) to use in conjunction with IR statistics (f-meas, auc or auprc). Omitting this option will use the class-weighted average.
Options specific to scheme weka.classifiers.rules.ZeroR:
-D If set, classifier is run in debug mode and may output additional info to the console
setOptions
in interface OptionHandler
setOptions
in class ASEvaluation
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic void setIRClassValue(java.lang.String val)
val
- the class label or 1-based index of the class label to use when
evaluating subsets with an IR metricpublic java.lang.String getIRClassValue()
public java.lang.String IRClassValueTipText()
public java.lang.String evaluationMeasureTipText()
public SelectedTag getEvaluationMeasure()
public void setEvaluationMeasure(SelectedTag newMethod)
newMethod
- the new performance evaluation metric to usepublic java.lang.String thresholdTipText()
public void setThreshold(double t)
t
- the value of the thresholdpublic double getThreshold()
public java.lang.String foldsTipText()
public void setFolds(int f)
f
- the number of foldspublic int getFolds()
public java.lang.String seedTipText()
public void setSeed(int s)
s
- the seedpublic int getSeed()
public java.lang.String classifierTipText()
public void setClassifier(Classifier newClassifier)
newClassifier
- the Classifier to use.public Classifier getClassifier()
public java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class ASEvaluation
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class ASEvaluation
Capabilities
public void buildEvaluator(Instances data) throws java.lang.Exception
buildEvaluator
in class ASEvaluation
data
- set of instances serving as training datajava.lang.Exception
- if the evaluator has not been generated successfullypublic double evaluateSubset(java.util.BitSet subset) throws java.lang.Exception
evaluateSubset
in interface SubsetEvaluator
subset
- a bitset representing the attribute subset to be evaluatedjava.lang.Exception
- if the subset could not be evaluatedpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class ASEvaluation
public void clean()
ASEvaluation
clean
in class ASEvaluation
public static void main(java.lang.String[] args)
args
- the options