All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.attributeSelection.WrapperSubsetEval

java.lang.Object
    |
    +----weka.attributeSelection.ASEvaluation
            |
            +----weka.attributeSelection.SubsetEvaluator
                    |
                    +----weka.attributeSelection.WrapperSubsetEval

public class WrapperSubsetEval
extends SubsetEvaluator
implements OptionHandler
Wrapper attribute subset evaluator.

For more information see:
Kohavi, R., John G., Wrappers for Feature Subset Selection. In Artificial Intelligence journal, special issue on relevance, Vol. 97, Nos 1-2, pp.273-324.

Valid options are:

-B
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.NaiveBayes ... -- -K

-F
Number of cross validation folds to use for estimating accuracy.

-T
Threshold by which to execute another cross validation (standard deviation ---expressed as a percentage of the mean).

Version:
$Revision: 1.13 $
Author:
Mark Hall (mhall@cs.waikato.ac.nz)

Constructor Index

 o WrapperSubsetEval()
Constructor.

Method Index

 o buildEvaluator(Instances)
Generates a attribute evaluator.
 o classifierTipText()
Returns the tip text for this property
 o evaluateSubset(BitSet)
Evaluates a subset of attributes
 o foldsTipText()
Returns the tip text for this property
 o getClassifier()
Get the classifier used as the base learner.
 o getFolds()
Get the number of folds used for accuracy estimation
 o getOptions()
Gets the current settings of WrapperSubsetEval.
 o getSeed()
Get the random number seed used for cross validation
 o getThreshold()
Get the value of the threshold
 o globalInfo()
Returns a string describing this attribute evaluator
 o listOptions()
Returns an enumeration describing the available options
 o main(String[])
Main method for testing this class.
 o seedTipText()
Returns the tip text for this property
 o setClassifier(Classifier)
Set the classifier to use for accuracy estimation
 o setFolds(int)
Set the number of folds to use for accuracy estimation
 o setOptions(String[])
Parses a given list of options.
 o setSeed(int)
Set the seed to use for cross validation
 o setThreshold(double)
Set the value of the threshold for repeating cross validation
 o thresholdTipText()
Returns the tip text for this property
 o toString()
Returns a string describing the wrapper

Constructor Detail

 o WrapperSubsetEval
public WrapperSubsetEval()
          Constructor. Calls restOptions to set default options

Method Detail

 o globalInfo
public java.lang.String globalInfo()
          Returns a string describing this attribute evaluator
Returns:
a description of the evaluator suitable for displaying in the explorer/experimenter gui
 o listOptions
public java.util.Enumeration listOptions()
          Returns an enumeration describing the available options
Returns:
an enumeration of all the available options
 o setOptions
public void setOptions(java.lang.String options[]) throws java.lang.Exception
          Parses a given list of options. Valid options are:

-B
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.NaiveBayes ... -- -K

-F
Number of cross validation folds to use for estimating accuracy.

-T
Threshold by which to execute another cross validation (standard deviation ---expressed as a percentage of the mean).

Parameters:
options - the list of options as an array of strings
Throws:
java.lang.Exception - if an option is not supported
 o thresholdTipText
public java.lang.String thresholdTipText()
          Returns the tip text for this property
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o setThreshold
public void setThreshold(double t)
          Set the value of the threshold for repeating cross validation
Parameters:
t - the value of the threshold
 o getThreshold
public double getThreshold()
          Get the value of the threshold
Returns:
the threshold as a double
 o foldsTipText
public java.lang.String foldsTipText()
          Returns the tip text for this property
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o setFolds
public void setFolds(int f)
          Set the number of folds to use for accuracy estimation
Parameters:
f - the number of folds
 o getFolds
public int getFolds()
          Get the number of folds used for accuracy estimation
Returns:
the number of folds
 o seedTipText
public java.lang.String seedTipText()
          Returns the tip text for this property
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o setSeed
public void setSeed(int s)
          Set the seed to use for cross validation
Parameters:
s - the seed
 o getSeed
public int getSeed()
          Get the random number seed used for cross validation
Returns:
the seed
 o classifierTipText
public java.lang.String classifierTipText()
          Returns the tip text for this property
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o setClassifier
public void setClassifier(Classifier newClassifier)
          Set the classifier to use for accuracy estimation
Parameters:
newClassifier - the Classifier to use.
 o getClassifier
public Classifier getClassifier()
          Get the classifier used as the base learner.
Returns:
the classifier used as the classifier
 o getOptions
public java.lang.String[] getOptions()
          Gets the current settings of WrapperSubsetEval.
Returns:
an array of strings suitable for passing to setOptions()
 o buildEvaluator
public void buildEvaluator(Instances data) throws java.lang.Exception
          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:
java.lang.Exception - if the evaluator has not been generated successfully
Overrides:
buildEvaluator in class ASEvaluation
 o evaluateSubset
public double evaluateSubset(java.util.BitSet subset) throws java.lang.Exception
          Evaluates a subset of attributes
Parameters:
subset - a bitset representing the attribute subset to be evaluated
Throws:
java.lang.Exception - if the subset could not be evaluated
Overrides:
evaluateSubset in class SubsetEvaluator
 o toString
public java.lang.String toString()
          Returns a string describing the wrapper
Returns:
the description as a string
Overrides:
toString in class java.lang.Object
 o main
public static void main(java.lang.String args[])
          Main method for testing this class.
Parameters:
args - the options

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home