类 CVParameterSelection

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

public class CVParameterSelection extends RandomizableSingleClassifierEnhancer implements Drawable, Summarizable, TechnicalInformationHandler
Class for performing parameter selection by cross-validation for any classifier.

For more information, see:

R. Kohavi (1995). Wrappers for Performance Enhancement and Oblivious Decision Graphs. Department of Computer Science, Stanford University.

BibTeX:

 @phdthesis{Kohavi1995,
    address = {Department of Computer Science, Stanford University},
    author = {R. Kohavi},
    school = {Stanford University},
    title = {Wrappers for Performance Enhancement and Oblivious Decision Graphs},
    year = {1995}
 }
 

Valid options are:

 -X <number of folds>
  Number of folds used for cross validation (default 10).
 -P <classifier parameter>
  Classifier parameter options.
  eg: "N 1 5 10" Sets an optimisation parameter for the
  classifier with name -N, with lower bound 1, upper bound
  5, and 10 optimisation steps. The upper bound may be the
  character 'A' or 'I' to substitute the number of
  attributes or instances in the training data,
  respectively. This parameter may be supplied more than
  once to optimise over several classifier options
  simultaneously.
 -S <num>
  Random number seed.
  (default 1)
 -D
  If set, classifier is run in debug mode and
  may output additional info to the console
 -W
  Full name of base classifier.
  (default: weka.classifiers.rules.ZeroR)
 
 Options specific to classifier weka.classifiers.rules.ZeroR:
 
 -D
  If set, classifier is run in debug mode and
  may output additional info to the console
Options after -- are passed to the designated sub-classifier.

版本:
$Revision: 8180 $
作者:
Len Trigg (trigg@cs.waikato.ac.nz)
另请参阅:
  • 构造器详细资料

    • CVParameterSelection

      public CVParameterSelection()
  • 方法详细资料

    • globalInfo

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

      public 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.
      指定者:
      getTechnicalInformation 在接口中 TechnicalInformationHandler
      返回:
      the technical information about this class
    • listOptions

      public Enumeration listOptions()
      Returns an enumeration describing the available options.
      指定者:
      listOptions 在接口中 OptionHandler
      覆盖:
      listOptions 在类中 RandomizableSingleClassifierEnhancer
      返回:
      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>
        Number of folds used for cross validation (default 10).
       -P <classifier parameter>
        Classifier parameter options.
        eg: "N 1 5 10" Sets an optimisation parameter for the
        classifier with name -N, with lower bound 1, upper bound
        5, and 10 optimisation steps. The upper bound may be the
        character 'A' or 'I' to substitute the number of
        attributes or instances in the training data,
        respectively. This parameter may be supplied more than
        once to optimise over several classifier options
        simultaneously.
       -S <num>
        Random number seed.
        (default 1)
       -D
        If set, classifier is run in debug mode and
        may output additional info to the console
       -W
        Full name of base classifier.
        (default: weka.classifiers.rules.ZeroR)
       
       Options specific to classifier weka.classifiers.rules.ZeroR:
       
       -D
        If set, classifier is run in debug mode and
        may output additional info to the console
      Options after -- are passed to the designated sub-classifier.

      指定者:
      setOptions 在接口中 OptionHandler
      覆盖:
      setOptions 在类中 RandomizableSingleClassifierEnhancer
      参数:
      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 在类中 RandomizableSingleClassifierEnhancer
      返回:
      an array of strings suitable for passing to setOptions
    • getBestClassifierOptions

      public String[] getBestClassifierOptions()
      Returns (a copy of) the best options found for the classifier.
      返回:
      the best options
    • getCapabilities

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

      public void buildClassifier(Instances instances) throws Exception
      Generates the classifier.
      指定者:
      buildClassifier 在类中 Classifier
      参数:
      instances - set of instances serving as training data
      抛出:
      Exception - if the classifier has not been generated successfully
    • distributionForInstance

      public double[] distributionForInstance(Instance instance) throws Exception
      Predicts the class distribution for the given test instance.
      覆盖:
      distributionForInstance 在类中 Classifier
      参数:
      instance - the instance to be classified
      返回:
      the predicted class value
      抛出:
      Exception - if an error occurred during the prediction
    • addCVParameter

      public void addCVParameter(String cvParam) throws Exception
      Adds a scheme parameter to the list of parameters to be set by cross-validation
      参数:
      cvParam - the string representation of a scheme parameter. The format is:
      param_char lower_bound upper_bound number_of_steps
      eg to search a parameter -P from 1 to 10 by increments of 1:
      P 1 10 11
      抛出:
      Exception - if the parameter specifier is of the wrong format
    • getCVParameter

      public String getCVParameter(int index)
      Gets the scheme paramter with the given index.
      参数:
      index - the index for the parameter
      返回:
      the scheme parameter
    • CVParametersTipText

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

      public Object[] getCVParameters()
      Get method for CVParameters.
      返回:
      the CVParameters
    • setCVParameters

      public void setCVParameters(Object[] params) throws Exception
      Set method for CVParameters.
      参数:
      params - the CVParameters to use
      抛出:
      Exception - if the setting of the CVParameters fails
    • 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 the cross-validation.
      返回:
      the number of folds for the cross-validation
    • setNumFolds

      public void setNumFolds(int numFolds) throws Exception
      Sets the number of folds for the cross-validation.
      参数:
      numFolds - the number of folds for the cross-validation
      抛出:
      Exception - if parameter illegal
    • graphType

      public int graphType()
      Returns the type of graph this classifier represents.
      指定者:
      graphType 在接口中 Drawable
      返回:
      the type of graph this classifier represents
    • graph

      public String graph() throws Exception
      Returns graph describing the classifier (if possible).
      指定者:
      graph 在接口中 Drawable
      返回:
      the graph of the classifier in dotty format
      抛出:
      Exception - if the classifier cannot be graphed
    • toString

      public String toString()
      Returns description of the cross-validated classifier.
      覆盖:
      toString 在类中 Object
      返回:
      description of the cross-validated classifier as a string
    • toSummaryString

      public String toSummaryString()
      A concise description of the model.
      指定者:
      toSummaryString 在接口中 Summarizable
      返回:
      a concise description of the model
    • 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 - the options