类 REPTree

java.lang.Object
weka.classifiers.Classifier
weka.classifiers.trees.REPTree
所有已实现的接口:
Serializable, Cloneable, Sourcable, AdditionalMeasureProducer, CapabilitiesHandler, Drawable, OptionHandler, Randomizable, RevisionHandler, WeightedInstancesHandler

Fast decision tree learner. Builds a decision/regression tree using information gain/variance and prunes it using reduced-error pruning (with backfitting). Only sorts values for numeric attributes once. Missing values are dealt with by splitting the corresponding instances into pieces (i.e. as in C4.5).

Valid options are:

 -M <minimum number of instances>
  Set minimum number of instances per leaf (default 2).
 -V <minimum variance for split>
  Set minimum numeric class variance proportion
  of train variance for split (default 1e-3).
 -N <number of folds>
  Number of folds for reduced error pruning (default 3).
 -S <seed>
  Seed for random data shuffling (default 1).
 -P
  No pruning.
 -L
  Maximum tree depth (default -1, no maximum)
版本:
$Revision: 10275 $
作者:
Eibe Frank (eibe@cs.waikato.ac.nz)
另请参阅:
  • 构造器详细资料

    • REPTree

      public REPTree()
  • 方法详细资料

    • globalInfo

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

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

      public boolean getNoPruning()
      Get the value of NoPruning.
      返回:
      Value of NoPruning.
    • setNoPruning

      public void setNoPruning(boolean newNoPruning)
      Set the value of NoPruning.
      参数:
      newNoPruning - Value to assign to NoPruning.
    • minNumTipText

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

      public double getMinNum()
      Get the value of MinNum.
      返回:
      Value of MinNum.
    • setMinNum

      public void setMinNum(double newMinNum)
      Set the value of MinNum.
      参数:
      newMinNum - Value to assign to MinNum.
    • minVariancePropTipText

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

      public double getMinVarianceProp()
      Get the value of MinVarianceProp.
      返回:
      Value of MinVarianceProp.
    • setMinVarianceProp

      public void setMinVarianceProp(double newMinVarianceProp)
      Set the value of MinVarianceProp.
      参数:
      newMinVarianceProp - Value to assign to MinVarianceProp.
    • seedTipText

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

      public int getSeed()
      Get the value of Seed.
      指定者:
      getSeed 在接口中 Randomizable
      返回:
      Value of Seed.
    • setSeed

      public void setSeed(int newSeed)
      Set the value of Seed.
      指定者:
      setSeed 在接口中 Randomizable
      参数:
      newSeed - Value to assign to 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()
      Get the value of NumFolds.
      返回:
      Value of NumFolds.
    • setNumFolds

      public void setNumFolds(int newNumFolds)
      Set the value of NumFolds.
      参数:
      newNumFolds - Value to assign to NumFolds.
    • maxDepthTipText

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

      public int getMaxDepth()
      Get the value of MaxDepth.
      返回:
      Value of MaxDepth.
    • setMaxDepth

      public void setMaxDepth(int newMaxDepth)
      Set the value of MaxDepth.
      参数:
      newMaxDepth - Value to assign to MaxDepth.
    • listOptions

      public Enumeration listOptions()
      Lists the command-line options for this classifier.
      指定者:
      listOptions 在接口中 OptionHandler
      覆盖:
      listOptions 在类中 Classifier
      返回:
      an enumeration over all commandline options
    • getOptions

      public String[] getOptions()
      Gets options from this classifier.
      指定者:
      getOptions 在接口中 OptionHandler
      覆盖:
      getOptions 在类中 Classifier
      返回:
      the options for the current setup
    • setOptions

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

      Valid options are:

       -M <minimum number of instances>
        Set minimum number of instances per leaf (default 2).
       -V <minimum variance for split>
        Set minimum numeric class variance proportion
        of train variance for split (default 1e-3).
       -N <number of folds>
        Number of folds for reduced error pruning (default 3).
       -S <seed>
        Seed for random data shuffling (default 1).
       -P
        No pruning.
       -L
        Maximum tree depth (default -1, no maximum)
      指定者:
      setOptions 在接口中 OptionHandler
      覆盖:
      setOptions 在类中 Classifier
      参数:
      options - the list of options as an array of strings
      抛出:
      Exception - if an option is not supported
    • numNodes

      public int numNodes()
      Computes size of the tree.
      返回:
      the number of nodes
    • enumerateMeasures

      public Enumeration enumerateMeasures()
      Returns an enumeration of the additional measure names.
      指定者:
      enumerateMeasures 在接口中 AdditionalMeasureProducer
      返回:
      an enumeration of the measure names
    • getMeasure

      public double getMeasure(String additionalMeasureName)
      Returns the value of the named measure.
      指定者:
      getMeasure 在接口中 AdditionalMeasureProducer
      参数:
      additionalMeasureName - the name of the measure to query for its value
      返回:
      the value of the named measure
      抛出:
      IllegalArgumentException - if the named measure is not supported
    • getCapabilities

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

      public void buildClassifier(Instances data) throws Exception
      Builds classifier.
      指定者:
      buildClassifier 在类中 Classifier
      参数:
      data - the data to train with
      抛出:
      Exception - if building fails
    • distributionForInstance

      public double[] distributionForInstance(Instance instance) throws Exception
      Computes class distribution of an instance using the tree.
      覆盖:
      distributionForInstance 在类中 Classifier
      参数:
      instance - the instance to compute the distribution for
      返回:
      the computed class probabilities
      抛出:
      Exception - if computation fails
    • toSource

      public String toSource(String className) throws Exception
      Returns the tree as if-then statements.
      指定者:
      toSource 在接口中 Sourcable
      参数:
      className - the name for the generated class
      返回:
      the tree as a Java if-then type statement
      抛出:
      Exception - if something goes wrong
    • graphType

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

      public String graph() throws Exception
      Outputs the decision tree as a graph
      指定者:
      graph 在接口中 Drawable
      返回:
      the tree as a graph
      抛出:
      Exception - if generation fails
    • toString

      public String toString()
      Outputs the decision tree.
      覆盖:
      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 this class.
      参数:
      argv - the commandline options