Class C45PruneableClassifierTree

java.lang.Object
weka.classifiers.trees.j48.ClassifierTree
weka.classifiers.trees.j48.C45PruneableClassifierTree
All Implemented Interfaces:
Serializable, CapabilitiesHandler, Drawable, RevisionHandler

public class C45PruneableClassifierTree extends ClassifierTree
Class for handling a tree structure that can be pruned using C4.5 procedures.
Version:
$Revision: 15122 $
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)
See Also:
  • Constructor Details

    • C45PruneableClassifierTree

      public C45PruneableClassifierTree(ModelSelection toSelectLocModel, boolean pruneTree, float cf, boolean raiseTree, boolean cleanup, boolean collapseTree) throws Exception
      Constructor for pruneable tree structure. Stores reference to associated training data at each node.
      Parameters:
      toSelectLocModel - selection method for local splitting model
      pruneTree - true if the tree is to be pruned
      cf - the confidence factor for pruning
      raiseTree -
      cleanup -
      Throws:
      Exception - if something goes wrong
  • Method Details

    • buildClassifier

      public void buildClassifier(Instances data) throws Exception
      Method for building a pruneable classifier tree.
      Overrides:
      buildClassifier in class ClassifierTree
      Parameters:
      data - the data for building the tree
      Throws:
      Exception - if something goes wrong
    • collapse

      public final void collapse()
      Collapses a tree to a node if training error doesn't increase.
    • prune

      public void prune() throws Exception
      Prunes a tree using C4.5's pruning procedure.
      Throws:
      Exception - if something goes wrong
    • getRevision

      public String getRevision()
      Returns the revision string.
      Specified by:
      getRevision in interface RevisionHandler
      Overrides:
      getRevision in class ClassifierTree
      Returns:
      the revision