public class PruneableClassifierTree extends ClassifierTree
m_id, m_isEmpty, m_isLeaf, m_localModel, m_sons, m_test, m_toSelectModel, m_train
BayesNet, Newick, NOT_DRAWABLE, TREE
Constructor and Description |
---|
PruneableClassifierTree(ModelSelection toSelectLocModel,
boolean pruneTree,
int num,
boolean cleanup,
int seed)
Constructor for pruneable tree structure.
|
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.
|
protected ClassifierTree |
getNewTree(Instances train,
Instances test)
Returns a newly created tree.
|
String |
getRevision()
Returns the revision string.
|
void |
prune()
Prunes a tree.
|
assignIDs, buildTree, buildTree, classifyInstance, cleanup, distributionForInstance, getNewTree, graph, graphType, nextID, numLeaves, numNodes, prefix, resetID, toSource, toString
public PruneableClassifierTree(ModelSelection toSelectLocModel, boolean pruneTree, int num, boolean cleanup, int seed) throws Exception
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 useException
- if something goes wrongpublic Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class ClassifierTree
Capabilities
public void buildClassifier(Instances data) throws Exception
buildClassifier
in class ClassifierTree
data
- the data to build the tree fromException
- if tree can't be built successfullypublic void prune() throws Exception
Exception
- if tree can't be pruned successfullyprotected ClassifierTree getNewTree(Instances train, Instances test) throws Exception
getNewTree
in class ClassifierTree
train
- the training datatest
- the test dataException
- if something goes wrongpublic String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class ClassifierTree
Copyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.