weka.classifiers.j48
Class C45PruneableClassifierTree
java.lang.Object
|
+--weka.classifiers.j48.ClassifierTree
|
+--weka.classifiers.j48.C45PruneableClassifierTree
- All Implemented Interfaces:
- Drawable, java.io.Serializable
- public class C45PruneableClassifierTree
- extends ClassifierTree
Class for handling a tree structure that can
be pruned using C4.5 procedures.
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz)
- See Also:
- Serialized Form
Methods inherited from class weka.classifiers.j48.ClassifierTree |
assignIDs, buildTree, buildTree, classifyInstance, cleanup, distributionForInstance, getNewTree, graph, nextID, numLeaves, numNodes, prefix, resetID, toSource, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
C45PruneableClassifierTree
public C45PruneableClassifierTree(ModelSelection toSelectLocModel,
boolean pruneTree,
float cf,
boolean raiseTree,
boolean cleanup)
throws java.lang.Exception
- Constructor for pruneable tree structure. Stores reference
to associated training data at each node.
- Parameters:
toSelectLocModel
- selection method for local splitting modelpruneTree
- true if the tree is to be prunedcf
- the confidence factor for pruning- Throws:
java.lang.Exception
- if something goes wrong
buildClassifier
public void buildClassifier(Instances data)
throws java.lang.Exception
- Method for building a pruneable classifier tree.
- Overrides:
buildClassifier
in class ClassifierTree
- Throws:
java.lang.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 java.lang.Exception
- Prunes a tree using C4.5's pruning procedure.
- Throws:
java.lang.Exception
- if something goes wrong
getNewTree
protected ClassifierTree getNewTree(Instances data)
throws java.lang.Exception
- Returns a newly created tree.
- Overrides:
getNewTree
in class ClassifierTree
- Throws:
java.lang.Exception
- if something goes wrong