|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.trees.j48.ClassifierTree
weka.classifiers.trees.j48.PruneableClassifierTree
Class for handling a tree structure that can be pruned using a pruning set.
Field Summary | |
private boolean |
m_cleanup
Cleanup after the tree has been built. |
private int |
m_seed
The random number seed. |
private int |
numSets
How many subsets of equal size? |
private boolean |
pruneTheTree
True if the tree is to be pruned. |
Fields inherited from class weka.classifiers.trees.j48.ClassifierTree |
m_id, m_isEmpty, m_isLeaf, m_localModel, m_sons, m_test, m_toSelectModel, m_train |
Fields inherited from interface weka.core.Drawable |
BayesNet, NOT_DRAWABLE, TREE |
Constructor Summary | |
PruneableClassifierTree(ModelSelection toSelectLocModel,
boolean pruneTree,
int num,
boolean cleanup,
int seed)
Constructor for pruneable tree structure. |
Method Summary | |
void |
buildClassifier(Instances data)
Method for building a pruneable classifier tree. |
private double |
errorsForLeaf()
Computes estimated errors for leaf. |
private double |
errorsForTree()
Computes estimated errors for tree. |
protected ClassifierTree |
getNewTree(Instances train,
Instances test)
Returns a newly created tree. |
private ClassifierSplitModel |
localModel()
Method just exists to make program easier to read. |
void |
prune()
Prunes a tree. |
private PruneableClassifierTree |
son(int index)
Method just exists to make program easier to read. |
Methods inherited from class weka.classifiers.trees.j48.ClassifierTree |
assignIDs, buildTree, buildTree, classifyInstance, cleanup, distributionForInstance, getNewTree, graph, graphType, nextID, numLeaves, numNodes, prefix, resetID, toSource, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private boolean pruneTheTree
private int numSets
private boolean m_cleanup
private int m_seed
Constructor Detail |
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 size
java.lang.Exception
- if something goes wrongMethod Detail |
public void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in class ClassifierTree
java.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 ClassifierTree
test
- the pruning data.
java.lang.Exception
- if something goes wrongprivate double errorsForTree() throws java.lang.Exception
java.lang.Exception
- if error estimate can't be computedprivate double errorsForLeaf() throws java.lang.Exception
java.lang.Exception
- if error estimate can't be computedprivate ClassifierSplitModel localModel()
private PruneableClassifierTree son(int index)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |