Package weka.classifiers.trees.j48
Class PruneableClassifierTree
java.lang.Object
weka.classifiers.trees.j48.ClassifierTree
weka.classifiers.trees.j48.PruneableClassifierTree
- All Implemented Interfaces:
Serializable
,CapabilitiesHandler
,Drawable
,RevisionHandler
Class for handling a tree structure that can
be pruned using a pruning set.
- Version:
- $Revision: 14511 $
- 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
ConstructorDescriptionPruneableClassifierTree
(ModelSelection toSelectLocModel, boolean pruneTree, int num, boolean cleanup, int seed) Constructor for pruneable tree structure. -
Method Summary
Modifier and TypeMethodDescriptionvoid
buildClassifier
(Instances data) Method for building a pruneable classifier tree.Returns the revision string.void
prune()
Prunes a tree.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
-
PruneableClassifierTree
public PruneableClassifierTree(ModelSelection toSelectLocModel, boolean pruneTree, int num, boolean cleanup, int seed) 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 prunednum
- number of subsets of equal sizecleanup
-seed
- the seed value to use- Throws:
Exception
- if something goes wrong
-
-
Method Details
-
buildClassifier
Method for building a pruneable classifier tree.- Overrides:
buildClassifier
in classClassifierTree
- Parameters:
data
- the data to build the tree from- Throws:
Exception
- if tree can't be built successfully
-
prune
Prunes a tree.- Throws:
Exception
- if tree can't be pruned successfully
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Overrides:
getRevision
in classClassifierTree
- Returns:
- the revision
-