类 J48graft

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

Class for generating a grafted (pruned or unpruned) C4.5 decision tree. For more information, see

Geoff Webb: Decision Tree Grafting From the All-Tests-But-One Partition. In: , San Francisco, CA, 1999.

BibTeX:

 @inproceedings{Webb1999,
    address = {San Francisco, CA},
    author = {Geoff Webb},
    publisher = {Morgan Kaufmann},
    title = {Decision Tree Grafting From the All-Tests-But-One Partition},
    year = {1999}
 }
 

Valid options are:

 -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)
 -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.  (note: this option only affects initial tree; grafting process always uses laplace).
 -E
  Relabel when grafting.
版本:
$Revision: 5535 $
作者:
Janice Boughton (jrbought@csse.monash.edu.au) (based on J48.java written by Eibe Frank)
另请参阅:
  • 构造器详细资料

    • J48graft

      public J48graft()
  • 方法详细资料

    • globalInfo

      public String globalInfo()
      Returns a string describing classifier
      返回:
      a description 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
    • getCapabilities

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

      public void buildClassifier(Instances instances) throws Exception
      Generates the classifier.
      指定者:
      buildClassifier 在类中 Classifier
      参数:
      instances - the data to train the classifier with
      抛出:
      Exception - if classifier can't be built successfully
    • classifyInstance

      public double classifyInstance(Instance instance) throws Exception
      Classifies an instance.
      覆盖:
      classifyInstance 在类中 Classifier
      参数:
      instance - the instance to classify
      返回:
      the classification for the instance
      抛出:
      Exception - if instance can't be classified successfully
    • distributionForInstance

      public final double[] distributionForInstance(Instance instance) throws Exception
      Returns class probabilities for an instance.
      覆盖:
      distributionForInstance 在类中 Classifier
      参数:
      instance - the instance to calculate the class probabilities for
      返回:
      the class probabilities
      抛出:
      Exception - if distribution can't be computed successfully
    • graphType

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

      public String graph() throws Exception
      Returns graph describing the tree.
      指定者:
      graph 在接口中 Drawable
      返回:
      the graph describing the tree
      抛出:
      Exception - if graph can't be computed
    • prefix

      public String prefix() throws Exception
      Returns tree in prefix order.
      指定者:
      prefix 在接口中 Matchable
      返回:
      the tree in prefix order
      抛出:
      Exception - if something goes wrong
    • toSource

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

      public Enumeration listOptions()
      Returns an enumeration describing the available options. Valid options are:

      -U
      Use unpruned tree.

      -C confidence
      Set confidence threshold for pruning. (Default: 0.25)

      -M number
      Set minimum number of instances per leaf. (Default: 2)

      -B
      Use binary splits for nominal attributes.

      -S
      Don't perform subtree raising.

      -L
      Do not clean up after the tree has been built. -A
      If set, Laplace smoothing is used for predicted probabilites. (note: this option only affects initial tree; grafting process always uses laplace).

      -E
      Allow relabelling when grafting.

      指定者:
      listOptions 在接口中 OptionHandler
      覆盖:
      listOptions 在类中 Classifier
      返回:
      an enumeration of all the available options.
    • setOptions

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

       -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)
       -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.  (note: this option only affects initial tree; grafting process always uses laplace).
       -E
        Relabel when grafting.
      指定者:
      setOptions 在接口中 OptionHandler
      覆盖:
      setOptions 在类中 Classifier
      参数:
      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 在类中 Classifier
      返回:
      an array of strings suitable for passing to setOptions
    • useLaplaceTipText

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

      public boolean getUseLaplace()
      Get the value of useLaplace.
      返回:
      Value of useLaplace.
    • setUseLaplace

      public void setUseLaplace(boolean newuseLaplace)
      Set the value of useLaplace.
      参数:
      newuseLaplace - Value to assign to useLaplace.
    • toString

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

      public String toSummaryString()
      Returns a superconcise version of the model
      指定者:
      toSummaryString 在接口中 Summarizable
      返回:
      a summary of the model
    • measureTreeSize

      public double measureTreeSize()
      Returns the size of the tree
      返回:
      the size of the tree
    • measureNumLeaves

      public double measureNumLeaves()
      Returns the number of leaves
      返回:
      the number of leaves
    • measureNumRules

      public double measureNumRules()
      Returns the number of rules (same as number of leaves)
      返回:
      the number of rules
    • 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
    • unprunedTipText

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

      public boolean getUnpruned()
      Get the value of unpruned.
      返回:
      Value of unpruned.
    • setUnpruned

      public void setUnpruned(boolean v)
      Set the value of unpruned.
      参数:
      v - Value to assign to unpruned.
    • relabelTipText

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

      public boolean getRelabel()
      Get the value of relabelling
      返回:
      Value of relabelling.
    • setRelabel

      public void setRelabel(boolean v)
      Set the value of relabelling.
      参数:
      v - Value to assign to relabelling flag.
    • confidenceFactorTipText

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

      public float getConfidenceFactor()
      Get the value of CF.
      返回:
      Value of CF.
    • setConfidenceFactor

      public void setConfidenceFactor(float v)
      Set the value of CF.
      参数:
      v - Value to assign to CF.
    • minNumObjTipText

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

      public int getMinNumObj()
      Get the value of minNumObj.
      返回:
      Value of minNumObj.
    • setMinNumObj

      public void setMinNumObj(int v)
      Set the value of minNumObj.
      参数:
      v - Value to assign to minNumObj.
    • binarySplitsTipText

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

      public boolean getBinarySplits()
      Get the value of binarySplits.
      返回:
      Value of binarySplits.
    • setBinarySplits

      public void setBinarySplits(boolean v)
      Set the value of binarySplits.
      参数:
      v - Value to assign to binarySplits.
    • subtreeRaisingTipText

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

      public boolean getSubtreeRaising()
      Get the value of subtreeRaising.
      返回:
      Value of subtreeRaising.
    • setSubtreeRaising

      public void setSubtreeRaising(boolean v)
      Set the value of subtreeRaising.
      参数:
      v - Value to assign to subtreeRaising.
    • saveInstanceDataTipText

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

      public boolean getSaveInstanceData()
      Check whether instance data is to be saved.
      返回:
      true if instance data is saved
    • setSaveInstanceData

      public void setSaveInstanceData(boolean v)
      Set whether instance data is to be saved.
      参数:
      v - true if instance data is to be saved
    • 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 commandline options