PruneableClassifierTree (original) (raw)
java.lang.Object
- weka.classifiers.trees.j48.ClassifierTree
- weka.classifiers.trees.j48.PruneableClassifierTree
All Implemented Interfaces:
java.io.Serializable, CapabilitiesHandler, Drawable, RevisionHandler
public class PruneableClassifierTree
extends ClassifierTree
Class for handling a tree structure that can be pruned using a pruning set.
Version: Revision:8985Revision: 8985 Revision:8985
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)
See Also:
Serialized Form
Field Summary
* ### Fields inherited from interface weka.core.[Drawable](../../../../weka/core/Drawable.html "interface in weka.core") `[BayesNet](../../../../weka/core/Drawable.html#BayesNet), [Newick](../../../../weka/core/Drawable.html#Newick), [NOT_DRAWABLE](../../../../weka/core/Drawable.html#NOT%5FDRAWABLE), [TREE](../../../../weka/core/Drawable.html#TREE)`
Constructor Summary
Constructors
Constructor and Description PruneableClassifierTree(ModelSelection toSelectLocModel, boolean pruneTree, int num, boolean cleanup, int seed) Constructor for pruneable tree structure. Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method and Description void buildClassifier(Instances data) Method for building a pruneable classifier tree. Capabilities getCapabilities() Returns default capabilities of the classifier tree. java.lang.String getRevision() Returns the revision string. void prune() Prunes a tree. * ### Methods inherited from class weka.classifiers.trees.j48.[ClassifierTree](../../../../weka/classifiers/trees/j48/ClassifierTree.html "class in weka.classifiers.trees.j48") `[assignIDs](../../../../weka/classifiers/trees/j48/ClassifierTree.html#assignIDs-int-), [buildTree](../../../../weka/classifiers/trees/j48/ClassifierTree.html#buildTree-weka.core.Instances-boolean-), [buildTree](../../../../weka/classifiers/trees/j48/ClassifierTree.html#buildTree-weka.core.Instances-weka.core.Instances-boolean-), [classifyInstance](../../../../weka/classifiers/trees/j48/ClassifierTree.html#classifyInstance-weka.core.Instance-), [cleanup](../../../../weka/classifiers/trees/j48/ClassifierTree.html#cleanup-weka.core.Instances-), [distributionForInstance](../../../../weka/classifiers/trees/j48/ClassifierTree.html#distributionForInstance-weka.core.Instance-boolean-), [graph](../../../../weka/classifiers/trees/j48/ClassifierTree.html#graph--), [graphType](../../../../weka/classifiers/trees/j48/ClassifierTree.html#graphType--), [numLeaves](../../../../weka/classifiers/trees/j48/ClassifierTree.html#numLeaves--), [numNodes](../../../../weka/classifiers/trees/j48/ClassifierTree.html#numNodes--), [prefix](../../../../weka/classifiers/trees/j48/ClassifierTree.html#prefix--), [toSource](../../../../weka/classifiers/trees/j48/ClassifierTree.html#toSource-java.lang.String-), [toString](../../../../weka/classifiers/trees/j48/ClassifierTree.html#toString--)` * ### Methods inherited from class java.lang.Object `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`
Constructor Detail
* #### PruneableClassifierTree public PruneableClassifierTree([ModelSelection](../../../../weka/classifiers/trees/j48/ModelSelection.html "class in weka.classifiers.trees.j48") toSelectLocModel, boolean pruneTree, int num, boolean cleanup, int seed) 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 model `pruneTree` \- true if the tree is to be pruned `num` \- number of subsets of equal size `cleanup` \- `seed` \- the seed value to use Throws: `java.lang.Exception` \- if something goes wrong
Method Detail
* #### getCapabilities public [Capabilities](../../../../weka/core/Capabilities.html "class in weka.core") getCapabilities() Returns default capabilities of the classifier tree. Specified by: `[getCapabilities](../../../../weka/core/CapabilitiesHandler.html#getCapabilities--)` in interface `[CapabilitiesHandler](../../../../weka/core/CapabilitiesHandler.html "interface in weka.core")` Overrides: `[getCapabilities](../../../../weka/classifiers/trees/j48/ClassifierTree.html#getCapabilities--)` in class `[ClassifierTree](../../../../weka/classifiers/trees/j48/ClassifierTree.html "class in weka.classifiers.trees.j48")` Returns: the capabilities of this classifier tree See Also: [Capabilities](../../../../weka/core/Capabilities.html "class in weka.core") * #### buildClassifier public void buildClassifier([Instances](../../../../weka/core/Instances.html "class in weka.core") data) throws java.lang.Exception Method for building a pruneable classifier tree. Overrides: `[buildClassifier](../../../../weka/classifiers/trees/j48/ClassifierTree.html#buildClassifier-weka.core.Instances-)` in class `[ClassifierTree](../../../../weka/classifiers/trees/j48/ClassifierTree.html "class in weka.classifiers.trees.j48")` Parameters: `data` \- the data to build the tree from Throws: `java.lang.Exception` \- if tree can't be built successfully * #### prune public void prune() throws java.lang.Exception Prunes a tree. Throws: `java.lang.Exception` \- if tree can't be pruned successfully * #### getRevision public java.lang.String getRevision() Returns the revision string. Specified by: `[getRevision](../../../../weka/core/RevisionHandler.html#getRevision--)` in interface `[RevisionHandler](../../../../weka/core/RevisionHandler.html "interface in weka.core")` Overrides: `[getRevision](../../../../weka/classifiers/trees/j48/ClassifierTree.html#getRevision--)` in class `[ClassifierTree](../../../../weka/classifiers/trees/j48/ClassifierTree.html "class in weka.classifiers.trees.j48")` Returns: the revision