类 RegressionByDiscretization

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

public class RegressionByDiscretization extends SingleClassifierEnhancer
A regression scheme that employs any classifier on a copy of the data that has the class attribute (equal-width) discretized. The predicted value is the expected value of the mean class value for each discretized interval (based on the predicted probabilities for each interval).

Valid options are:

 -B <int>
  Number of bins for equal-width discretization
  (default 10).
 
 -E
  Whether to delete empty bins after discretization
  (default false).
 
 -F
  Use equal-frequency instead of equal-width discretization.
 -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.trees.J48)
 
 Options specific to classifier weka.classifiers.trees.J48:
 
 -U
  Use unpruned tree.
 -C <pruning confidence>
  Set confidence threshold for pruning.
  (default 0.25)
 -M <minimum number of instances>
  Set minimum number of instances per leaf.
  (default 2)
 -R
  Use reduced error pruning.
 -N <number of folds>
  Set number of folds for reduced error
  pruning. One fold is used as pruning set.
  (default 3)
 -B
  Use binary splits only.
 -S
  Don't perform subtree raising.
 -L
  Do not clean up after the tree has been built.
 -A
  Laplace smoothing for predicted probabilities.
 -Q <seed>
  Seed for random data shuffling (default 1).
版本:
$Revision: 4746 $
作者:
Len Trigg (trigg@cs.waikato.ac.nz), Eibe Frank (eibe@cs.waikato.ac.nz)
另请参阅:
  • 构造器详细资料

    • RegressionByDiscretization

      public RegressionByDiscretization()
      Default constructor.
  • 方法详细资料

    • globalInfo

      public String globalInfo()
      Returns a string describing classifier
      返回:
      a description suitable for displaying in the explorer/experimenter gui
    • 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
    • classifyInstance

      public double classifyInstance(Instance instance) throws Exception
      Returns a predicted class for the test instance.
      覆盖:
      classifyInstance 在类中 Classifier
      参数:
      instance - the instance to be classified
      返回:
      predicted class value
      抛出:
      Exception - if the prediction couldn't be made
    • listOptions

      public Enumeration listOptions()
      Returns an enumeration describing the available options.
      指定者:
      listOptions 在接口中 OptionHandler
      覆盖:
      listOptions 在类中 SingleClassifierEnhancer
      返回:
      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 <int>
        Number of bins for equal-width discretization
        (default 10).
       
       -E
        Whether to delete empty bins after discretization
        (default false).
       
       -F
        Use equal-frequency instead of equal-width discretization.
       -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.trees.J48)
       
       Options specific to classifier weka.classifiers.trees.J48:
       
       -U
        Use unpruned tree.
       -C <pruning confidence>
        Set confidence threshold for pruning.
        (default 0.25)
       -M <minimum number of instances>
        Set minimum number of instances per leaf.
        (default 2)
       -R
        Use reduced error pruning.
       -N <number of folds>
        Set number of folds for reduced error
        pruning. One fold is used as pruning set.
        (default 3)
       -B
        Use binary splits only.
       -S
        Don't perform subtree raising.
       -L
        Do not clean up after the tree has been built.
       -A
        Laplace smoothing for predicted probabilities.
       -Q <seed>
        Seed for random data shuffling (default 1).
      指定者:
      setOptions 在接口中 OptionHandler
      覆盖:
      setOptions 在类中 SingleClassifierEnhancer
      参数:
      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 在类中 SingleClassifierEnhancer
      返回:
      an array of strings suitable for passing to setOptions
    • numBinsTipText

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

      public int getNumBins()
      Gets the number of bins numeric attributes will be divided into
      返回:
      the number of bins.
    • setNumBins

      public void setNumBins(int numBins)
      Sets the number of bins to divide each selected numeric attribute into
      参数:
      numBins - the number of bins
    • deleteEmptyBinsTipText

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

      public boolean getDeleteEmptyBins()
      Gets the number of bins numeric attributes will be divided into
      返回:
      the number of bins.
    • setDeleteEmptyBins

      public void setDeleteEmptyBins(boolean b)
      Sets the number of bins to divide each selected numeric attribute into
      参数:
      numBins - the number of bins
    • useEqualFrequencyTipText

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

      public boolean getUseEqualFrequency()
      Get the value of UseEqualFrequency.
      返回:
      Value of UseEqualFrequency.
    • setUseEqualFrequency

      public void setUseEqualFrequency(boolean newUseEqualFrequency)
      Set the value of UseEqualFrequency.
      参数:
      newUseEqualFrequency - Value to assign to UseEqualFrequency.
    • toString

      public String toString()
      Returns a description of the classifier.
      覆盖:
      toString 在类中 Object
      返回:
      a description of the classifier as a string.
    • 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