类 MultiScheme

所有已实现的接口:
Serializable, Cloneable, CapabilitiesHandler, OptionHandler, Randomizable, RevisionHandler

public class MultiScheme extends RandomizableMultipleClassifiersCombiner
Class for selecting a classifier from among several using cross validation on the training data or the performance on the training data. Performance is measured based on percent correct (classification) or mean-squared error (regression).

Valid options are:

 -X <number of folds>
  Use cross validation for model selection using the
  given number of folds. (default 0, is to
  use training error)
 -S <num>
  Random number seed.
  (default 1)
 -B <classifier specification>
  Full class name of classifier to include, followed
  by scheme options. May be specified multiple times.
  (default: "weka.classifiers.rules.ZeroR")
 -D
  If set, classifier is run in debug mode and
  may output additional info to the console
版本:
$Revision: 1.25 $
作者:
Len Trigg (trigg@cs.waikato.ac.nz)
另请参阅:
  • 构造器详细资料

    • MultiScheme

      public MultiScheme()
  • 方法详细资料

    • globalInfo

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

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

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

      Valid options are:

       -X <number of folds>
        Use cross validation for model selection using the
        given number of folds. (default 0, is to
        use training error)
       -S <num>
        Random number seed.
        (default 1)
       -B <classifier specification>
        Full class name of classifier to include, followed
        by scheme options. May be specified multiple times.
        (default: "weka.classifiers.rules.ZeroR")
       -D
        If set, classifier is run in debug mode and
        may output additional info to the console
      指定者:
      setOptions 在接口中 OptionHandler
      覆盖:
      setOptions 在类中 RandomizableMultipleClassifiersCombiner
      参数:
      options - the list of options as an array of strings
      抛出:
      Exception - if an option is not supported
    • getOptions

      public String[] getOptions()
      Gets the current settings of the Classifier.
      指定者:
      getOptions 在接口中 OptionHandler
      覆盖:
      getOptions 在类中 RandomizableMultipleClassifiersCombiner
      返回:
      an array of strings suitable for passing to setOptions
    • classifiersTipText

      public String classifiersTipText()
      Returns the tip text for this property
      覆盖:
      classifiersTipText 在类中 MultipleClassifiersCombiner
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • setClassifiers

      public void setClassifiers(Classifier[] classifiers)
      Sets the list of possible classifers to choose from.
      覆盖:
      setClassifiers 在类中 MultipleClassifiersCombiner
      参数:
      classifiers - an array of classifiers with all options set.
    • getClassifiers

      public Classifier[] getClassifiers()
      Gets the list of possible classifers to choose from.
      覆盖:
      getClassifiers 在类中 MultipleClassifiersCombiner
      返回:
      the array of Classifiers
    • getClassifier

      public Classifier getClassifier(int index)
      Gets a single classifier from the set of available classifiers.
      覆盖:
      getClassifier 在类中 MultipleClassifiersCombiner
      参数:
      index - the index of the classifier wanted
      返回:
      the Classifier
    • seedTipText

      public String seedTipText()
      Returns the tip text for this property
      覆盖:
      seedTipText 在类中 RandomizableMultipleClassifiersCombiner
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • setSeed

      public void setSeed(int seed)
      Sets the seed for random number generation.
      指定者:
      setSeed 在接口中 Randomizable
      覆盖:
      setSeed 在类中 RandomizableMultipleClassifiersCombiner
      参数:
      seed - the random number seed
    • getSeed

      public int getSeed()
      Gets the random number seed.
      指定者:
      getSeed 在接口中 Randomizable
      覆盖:
      getSeed 在类中 RandomizableMultipleClassifiersCombiner
      返回:
      the random number seed
    • numFoldsTipText

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

      public int getNumFolds()
      Gets the number of folds for cross-validation. A number less than 2 specifies using training error rather than cross-validation.
      返回:
      the number of folds for cross-validation
    • setNumFolds

      public void setNumFolds(int numFolds)
      Sets the number of folds for cross-validation. A number less than 2 specifies using training error rather than cross-validation.
      参数:
      numFolds - the number of folds for cross-validation
    • debugTipText

      public String debugTipText()
      Returns the tip text for this property
      覆盖:
      debugTipText 在类中 Classifier
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • setDebug

      public void setDebug(boolean debug)
      Set debugging mode
      覆盖:
      setDebug 在类中 Classifier
      参数:
      debug - true if debug output should be printed
    • getDebug

      public boolean getDebug()
      Get whether debugging is turned on
      覆盖:
      getDebug 在类中 Classifier
      返回:
      true if debugging output is on
    • getBestClassifierIndex

      public int getBestClassifierIndex()
      Get the index of the classifier that was determined as best during cross-validation.
      返回:
      the index in the classifier array
    • buildClassifier

      public void buildClassifier(Instances data) throws Exception
      Buildclassifier selects a classifier from the set of classifiers by minimising error on the training data.
      指定者:
      buildClassifier 在类中 Classifier
      参数:
      data - the training data to be used for generating the boosted classifier.
      抛出:
      Exception - if the classifier could not be built successfully
    • distributionForInstance

      public double[] distributionForInstance(Instance instance) throws Exception
      Returns class probabilities.
      覆盖:
      distributionForInstance 在类中 Classifier
      参数:
      instance - the instance to be classified
      返回:
      the distribution for the instance
      抛出:
      Exception - if instance could not be classified successfully
    • toString

      public String toString()
      Output a representation of this classifier
      覆盖:
      toString 在类中 Object
      返回:
      a string representation of the classifier
    • getRevision

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

      public static void main(String[] argv)
      Main method for testing this class.
      参数:
      argv - should contain the following arguments: -t training file [-T test file] [-c class index]