public class PruneableClassifierTree extends ClassifierTree
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
m_cleanup
Cleanup after the tree has been built.
|
protected int |
m_seed
The random number seed.
|
protected int |
numSets
How many subsets of equal size?
|
protected boolean |
pruneTheTree
True if the tree is to be pruned.
|
m_id, m_isEmpty, m_isLeaf, m_localModel, m_sons, m_test, m_toSelectModel, m_trainBayesNet, 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.
|
protected ClassifierTree |
getNewTree(Instances train,
Instances test)
Returns a newly created tree.
|
java.lang.String |
getRevision()
Returns the revision string.
|
void |
prune()
Prunes a tree.
|
assignIDs, buildTree, buildTree, classifyInstance, cleanup, distributionForInstance, getCapabilities, getLocalModel, getMembershipValues, getNewTree, getSons, getTrainingData, graph, graphType, isLeaf, nextID, numLeaves, numNodes, prefix, resetID, toSource, toStringprotected boolean pruneTheTree
protected int numSets
protected boolean m_cleanup
protected int m_seed
public PruneableClassifierTree(ModelSelection toSelectLocModel, boolean pruneTree, int num, boolean cleanup, int seed) throws java.lang.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 usejava.lang.Exception - if something goes wrongpublic void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier in class ClassifierTreedata - the data to build the tree fromjava.lang.Exception - if tree can't be built successfullypublic void prune()
throws java.lang.Exception
java.lang.Exception - if tree can't be pruned successfullyprotected ClassifierTree getNewTree(Instances train, Instances test) throws java.lang.Exception
getNewTree in class ClassifierTreetrain - the training datatest - the test datajava.lang.Exception - if something goes wrongpublic java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class ClassifierTree