类 ADTree

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

Class for generating an alternating decision tree. The basic algorithm is based on:

Freund, Y., Mason, L.: The alternating decision tree learning algorithm. In: Proceeding of the Sixteenth International Conference on Machine Learning, Bled, Slovenia, 124-133, 1999.

This version currently only supports two-class problems. The number of boosting iterations needs to be manually tuned to suit the dataset and the desired complexity/accuracy tradeoff. Induction of the trees has been optimized, and heuristic search methods have been introduced to speed learning.

BibTeX:

 @inproceedings{Freund1999,
    address = {Bled, Slovenia},
    author = {Freund, Y. and Mason, L.},
    booktitle = {Proceeding of the Sixteenth International Conference on Machine Learning},
    pages = {124-133},
    title = {The alternating decision tree learning algorithm},
    year = {1999}
 }
 

Valid options are:

 -B <number of boosting iterations>
  Number of boosting iterations.
  (Default = 10)
 -E <-3|-2|-1|>=0>
  Expand nodes: -3(all), -2(weight), -1(z_pure), >=0 seed for random walk
  (Default = -3)
 -D
  Save the instance data with the model
版本:
$Revision: 10290 $
作者:
Richard Kirkby (rkirkby@cs.waikato.ac.nz), Bernhard Pfahringer (bernhard@cs.waikato.ac.nz)
另请参阅:
  • 字段详细资料

    • SEARCHPATH_ALL

      public static final int SEARCHPATH_ALL
      search mode: Expand all paths
      另请参阅:
    • SEARCHPATH_HEAVIEST

      public static final int SEARCHPATH_HEAVIEST
      search mode: Expand the heaviest path
      另请参阅:
    • SEARCHPATH_ZPURE

      public static final int SEARCHPATH_ZPURE
      search mode: Expand the best z-pure path
      另请参阅:
    • SEARCHPATH_RANDOM

      public static final int SEARCHPATH_RANDOM
      search mode: Expand a random path
      另请参阅:
    • TAGS_SEARCHPATH

      public static final Tag[] TAGS_SEARCHPATH
      The search modes
  • 构造器详细资料

    • ADTree

      public ADTree()
  • 方法详细资料

    • 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
    • initClassifier

      public void initClassifier(Instances instances) throws Exception
      Sets up the tree ready to be trained, using two-class optimized method.
      指定者:
      initClassifier 在接口中 IterativeClassifier
      参数:
      instances - the instances to train the tree with
      抛出:
      Exception - if training data is unsuitable
    • next

      public void next(int iteration) throws Exception
      Performs one iteration.
      指定者:
      next 在接口中 IterativeClassifier
      参数:
      iteration - the index of the current iteration (0-based)
      抛出:
      Exception - if this iteration fails
    • boost

      public void boost() throws Exception
      Performs a single boosting iteration, using two-class optimized method. Will add a new splitter node and two prediction nodes to the tree (unless merging takes place).
      抛出:
      Exception - if try to boost without setting up tree first or there are no instances to train with
    • distributionForInstance

      public double[] distributionForInstance(Instance instance)
      Returns the class probability distribution for an instance.
      覆盖:
      distributionForInstance 在类中 Classifier
      参数:
      instance - the instance to be classified
      返回:
      the distribution the tree generates for the instance
    • toString

      public String toString()
      Returns a description of the classifier.
      覆盖:
      toString 在类中 Object
      返回:
      a string containing a description of the classifier
    • 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 of the tree in dotty format
      抛出:
      Exception - if something goes wrong
    • legend

      public String legend()
      Returns the legend of the tree, describing how results are to be interpreted.
      返回:
      a string containing the legend of the classifier
    • numOfBoostingIterationsTipText

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

      public int getNumOfBoostingIterations()
      Gets the number of boosting iterations.
      返回:
      the number of boosting iterations
    • setNumOfBoostingIterations

      public void setNumOfBoostingIterations(int b)
      Sets the number of boosting iterations.
      参数:
      b - the number of boosting iterations to use
    • searchPathTipText

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

      public SelectedTag getSearchPath()
      Gets the method of searching the tree for a new insertion. Will be one of SEARCHPATH_ALL, SEARCHPATH_HEAVIEST, SEARCHPATH_ZPURE, SEARCHPATH_RANDOM.
      返回:
      the tree searching mode
    • setSearchPath

      public void setSearchPath(SelectedTag newMethod)
      Sets the method of searching the tree for a new insertion. Will be one of SEARCHPATH_ALL, SEARCHPATH_HEAVIEST, SEARCHPATH_ZPURE, SEARCHPATH_RANDOM.
      参数:
      newMethod - the new tree searching mode
    • randomSeedTipText

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

      public int getRandomSeed()
      Gets random seed for a random walk.
      返回:
      the random seed
    • setRandomSeed

      public void setRandomSeed(int seed)
      Sets random seed for a random walk.
      参数:
      seed - the random seed
    • saveInstanceDataTipText

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

      public boolean getSaveInstanceData()
      Gets whether the tree is to save instance data.
      返回:
      the random seed
    • setSaveInstanceData

      public void setSaveInstanceData(boolean v)
      Sets whether the tree is to save instance data.
      参数:
      v - true then the tree saves instance data
    • listOptions

      public Enumeration listOptions()
      Returns an enumeration describing the available options..
      指定者:
      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:

      -B num
      Set the number of boosting iterations (default 10)

      -E num
      Set the nodes to expand: -3(all), -2(weight), -1(z_pure), >=0 seed for random walk (default -3)

      -D
      Save the instance data with the model

      指定者:
      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 ADTree.
      指定者:
      getOptions 在接口中 OptionHandler
      覆盖:
      getOptions 在类中 Classifier
      返回:
      an array of strings suitable for passing to setOptions()
    • measureTreeSize

      public double measureTreeSize()
      Calls measure function for tree size - the total number of nodes.
      返回:
      the tree size
    • measureNumLeaves

      public double measureNumLeaves()
      Calls measure function for leaf size - the number of prediction nodes.
      返回:
      the leaf size
    • measureNumPredictionLeaves

      public double measureNumPredictionLeaves()
      Calls measure function for prediction leaf size - the number of prediction nodes without children.
      返回:
      the leaf size
    • measureNodesExpanded

      public double measureNodesExpanded()
      Returns the number of nodes expanded.
      返回:
      the number of nodes expanded during search
    • measureExamplesProcessed

      public double measureExamplesProcessed()
      Returns the number of examples "counted".
      返回:
      the number of nodes processed during search
    • 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
    • nextSplitAddedOrder

      public int nextSplitAddedOrder()
      Returns the next number in the order that splitter nodes have been added to the tree, and records that a new splitter has been added.
      返回:
      the next number in the order
    • 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
      Builds a classifier for a set of instances.
      指定者:
      buildClassifier 在类中 Classifier
      参数:
      instances - the instances to train the classifier with
      抛出:
      Exception - if something goes wrong
    • done

      public void done()
      Frees memory that is no longer needed for a final model - will no longer be able to increment the classifier after calling this.
      指定者:
      done 在接口中 IterativeClassifier
    • clone

      public Object clone()
      Creates a clone that is identical to the current tree, but is independent. Deep copies the essential elements such as the tree nodes, and the instances (because the weights change.) Reference copies several elements such as the potential splitter sets, assuming that such elements should never differ between clones.
      指定者:
      clone 在接口中 IterativeClassifier
      返回:
      the clone
    • merge

      public void merge(ADTree mergeWith) throws Exception
      Merges two trees together. Modifies the tree being acted on, leaving tree passed as a parameter untouched (cloned). Does not check to see whether training instances are compatible - strange things could occur if they are not.
      参数:
      mergeWith - the tree to merge with
      抛出:
      Exception - if merge could not be performed
    • 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