Package weka.classifiers.trees.j48
Class C45PruneableClassifierTree
java.lang.Object
weka.classifiers.trees.j48.ClassifierTree
weka.classifiers.trees.j48.C45PruneableClassifierTree
- All Implemented Interfaces:
Serializable
,CapabilitiesHandler
,Drawable
,RevisionHandler
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:
-
Field Summary
Fields inherited from interface weka.core.Drawable
BayesNet, Newick, NOT_DRAWABLE, TREE
-
Constructor Summary
ConstructorDescriptionC45PruneableClassifierTree
(ModelSelection toSelectLocModel, boolean pruneTree, float cf, boolean raiseTree, boolean cleanup, boolean collapseTree) Constructor for pruneable tree structure. -
Method Summary
Modifier and TypeMethodDescriptionvoid
buildClassifier
(Instances data) Method for building a pruneable classifier tree.final void
collapse()
Collapses a tree to a node if training error doesn't increase.Returns the revision string.void
prune()
Prunes a tree using C4.5's pruning procedure.Methods inherited from class weka.classifiers.trees.j48.ClassifierTree
assignIDs, buildTree, buildTree, classifyInstance, cleanup, distributionForInstance, getCapabilities, getLocalModel, getMembershipValues, getSons, getTrainingData, graph, graphType, isLeaf, numLeaves, numNodes, prefix, toSource, toString
-
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 modelpruneTree
- true if the tree is to be prunedcf
- the confidence factor for pruningraiseTree
-cleanup
-- Throws:
Exception
- if something goes wrong
-
-
Method Details
-
buildClassifier
Method for building a pruneable classifier tree.- Overrides:
buildClassifier
in classClassifierTree
- 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
Prunes a tree using C4.5's pruning procedure.- Throws:
Exception
- if something goes wrong
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Overrides:
getRevision
in classClassifierTree
- Returns:
- the revision
-