类 ClassifierSubsetEval

所有已实现的接口:
Serializable, ErrorBasedMeritEvaluator, SubsetEvaluator, CapabilitiesHandler, OptionHandler, RevisionHandler

public class ClassifierSubsetEval extends HoldOutSubsetEvaluator implements OptionHandler, ErrorBasedMeritEvaluator
Classifier subset evaluator:

Evaluates attribute subsets on training data or a seperate hold out testing set. Uses a classifier to estimate the 'merit' of a set of attributes.

Valid options are:

 -B <classifier>
  class name of the classifier 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)
 -T
  Use the training data to estimate accuracy.
 -H <filename>
  Name of the hold out/test set to 
  estimate accuracy on.
 
 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
版本:
$Revision: 5511 $
作者:
Mark Hall (mhall@cs.waikato.ac.nz)
另请参阅:
  • 构造器详细资料

    • ClassifierSubsetEval

      public ClassifierSubsetEval()
  • 方法详细资料

    • globalInfo

      public String globalInfo()
      Returns a string describing this attribute evaluator
      返回:
      a description of the evaluator suitable for displaying in the explorer/experimenter gui
    • listOptions

      public Enumeration listOptions()
      Returns an enumeration describing the available options.
      指定者:
      listOptions 在接口中 OptionHandler
      返回:
      an enumeration of all the available options.
    • setOptions

      public void setOptions(String[] options) throws Exception
      Parses a given list of options.

      Valid options are:

       -B <classifier>
        class name of the classifier 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)
       -T
        Use the training data to estimate accuracy.
       -H <filename>
        Name of the hold out/test set to 
        estimate accuracy on.
       
       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 在接口中 OptionHandler
      参数:
      options - the list of options as an array of strings
      抛出:
      Exception - if an option is not supported
    • classifierTipText

      public String classifierTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • setClassifier

      public void setClassifier(Classifier newClassifier)
      Set the classifier to use for accuracy estimation
      参数:
      newClassifier - the Classifier to use.
    • getClassifier

      public Classifier getClassifier()
      Get the classifier used as the base learner.
      返回:
      the classifier used as the classifier
    • holdOutFileTipText

      public String holdOutFileTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • getHoldOutFile

      public File getHoldOutFile()
      Gets the file that holds hold out/test instances.
      返回:
      File that contains hold out instances
    • setHoldOutFile

      public void setHoldOutFile(File h)
      Set the file that contains hold out/test instances
      参数:
      h - the hold out file
    • useTrainingTipText

      public String useTrainingTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • getUseTraining

      public boolean getUseTraining()
      Get if training data is to be used instead of hold out/test data
      返回:
      true if training data is to be used instead of hold out data
    • setUseTraining

      public void setUseTraining(boolean t)
      Set if training data is to be used instead of hold out/test data
      参数:
      t - true if training data is to be used instead of hold out data
    • getOptions

      public String[] getOptions()
      Gets the current settings of ClassifierSubsetEval
      指定者:
      getOptions 在接口中 OptionHandler
      返回:
      an array of strings suitable for passing to setOptions()
    • getCapabilities

      public Capabilities getCapabilities()
      Returns the capabilities of this evaluator.
      指定者:
      getCapabilities 在接口中 CapabilitiesHandler
      覆盖:
      getCapabilities 在类中 ASEvaluation
      返回:
      the capabilities of this evaluator
      另请参阅:
    • buildEvaluator

      public void buildEvaluator(Instances data) throws Exception
      Generates a attribute evaluator. Has to initialize all fields of the evaluator that are not being set via options.
      指定者:
      buildEvaluator 在类中 ASEvaluation
      参数:
      data - set of instances serving as training data
      抛出:
      Exception - if the evaluator has not been generated successfully
    • evaluateSubset

      public double evaluateSubset(BitSet subset) throws Exception
      Evaluates a subset of attributes
      指定者:
      evaluateSubset 在接口中 SubsetEvaluator
      参数:
      subset - a bitset representing the attribute subset to be evaluated
      返回:
      the error rate
      抛出:
      Exception - if the subset could not be evaluated
    • evaluateSubset

      public double evaluateSubset(BitSet subset, Instances holdOut) throws Exception
      Evaluates a subset of attributes with respect to a set of instances. Calling this function overides any test/hold out instancs set from setHoldOutFile.
      指定者:
      evaluateSubset 在类中 HoldOutSubsetEvaluator
      参数:
      subset - a bitset representing the attribute subset to be evaluated
      holdOut - a set of instances (possibly seperate and distinct from those use to build/train the evaluator) with which to evaluate the merit of the subset
      返回:
      the "merit" of the subset on the holdOut data
      抛出:
      Exception - if the subset cannot be evaluated
    • evaluateSubset

      public double evaluateSubset(BitSet subset, Instance holdOut, boolean retrain) throws Exception
      Evaluates a subset of attributes with respect to a single instance. Calling this function overides any hold out/test instances set through setHoldOutFile.
      指定者:
      evaluateSubset 在类中 HoldOutSubsetEvaluator
      参数:
      subset - a bitset representing the attribute subset to be evaluated
      holdOut - a single instance (possibly not one of those used to build/train the evaluator) with which to evaluate the merit of the subset
      retrain - true if the classifier should be retrained with respect to the new subset before testing on the holdOut instance.
      返回:
      the "merit" of the subset on the holdOut instance
      抛出:
      Exception - if the subset cannot be evaluated
    • toString

      public String toString()
      Returns a string describing classifierSubsetEval
      覆盖:
      toString 在类中 Object
      返回:
      the description as a string
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      覆盖:
      getRevision 在类中 ASEvaluation
      返回:
      the revision
    • main

      public static void main(String[] args)
      Main method for testing this class.
      参数:
      args - the options