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`

public class PruneableClassifierTree extends ClassifierTree
Class for handling a tree structure that can be pruned using a pruning set.

Version:
  $Revision: 8985 $
Author:
  Eibe Frank (eibe@cs.waikato.ac.nz)
See Also:
  - Serialized Form

## Field Summary

### Fields inherited from interface weka.core.Drawable

`BayesNet, Newick, NOT_DRAWABLE, TREE`

## Constructor Summary

Constructors
Constructor
Description
`PruneableClassifierTree(ModelSelection toSelectLocModel, boolean pruneTree, int num, boolean cleanup, int seed)`
Constructor for pruneable tree structure.

## Method Summary

Modifier and Type
Method
Description
`void`
`buildClassifier(Instances data)`
Method for building a pruneable classifier tree.
`Capabilities`
`getCapabilities()`
Returns default capabilities of the classifier tree.
`String`
`getRevision()`
Returns the revision string.
`void`
`prune()`
Prunes a tree.

### Methods inherited from class weka.classifiers.trees.j48.ClassifierTree

`assignIDs, buildTree, buildTree, classifyInstance, cleanup, distributionForInstance, graph, graphType, numLeaves, numNodes, prefix, toSource, toString`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## 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 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:
  `Exception` - if something goes wrong

## Method Details

### getCapabilities

public Capabilities getCapabilities()
Returns default capabilities of the classifier tree.

Specified by:
  `getCapabilities` in interface `CapabilitiesHandler`
Overrides:
  `getCapabilities` in class `ClassifierTree`
Returns:
  the capabilities of this classifier tree
See Also:
  - `Capabilities`

### buildClassifier

public void buildClassifier(Instances data) throws Exception
Method for building a pruneable classifier tree.

Overrides:
  `buildClassifier` in class `ClassifierTree`
Parameters:
  `data` - the data to build the tree from
Throws:
  `Exception` - if tree can't be built successfully

### prune

public void prune() throws Exception
Prunes a tree.

Throws:
  `Exception` - if tree can't be pruned successfully

### getRevision

public String getRevision()
Returns the revision string.

Specified by:
  `getRevision` in interface `RevisionHandler`
Overrides:
  `getRevision` in class `ClassifierTree`
Returns:
  the revision