|
||||||||||
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.C45PruneableClassifierTreeG
public class C45PruneableClassifierTreeG
Class for handling a tree structure that can be pruned using C4.5 procedures and have nodes grafted on.
Field Summary |
---|
Fields inherited from interface weka.core.Drawable |
---|
BayesNet, NOT_DRAWABLE, TREE |
Constructor Summary | |
---|---|
C45PruneableClassifierTreeG(ModelSelection toSelectLocModel,
boolean pruneTree,
float cf,
boolean raiseTree,
boolean relabel,
boolean cleanup)
Constructor for pruneable tree structure. |
|
C45PruneableClassifierTreeG(ModelSelection toSelectLocModel,
Instances data,
ClassifierSplitModel gs,
boolean prune,
float cf,
boolean raise,
boolean isLeaf,
boolean relabel,
boolean cleanup)
Constructor for pruneable tree structure. |
Method Summary | |
---|---|
double |
biprob(double x,
double n,
double r)
Significance test |
void |
buildClassifier(Instances data)
Method for building a pruneable classifier tree. |
void |
collapse()
Collapses a tree to a node if training error doesn't increase. |
void |
doGrafting(Instances data)
Initializes variables for grafting. |
Capabilities |
getCapabilities()
Returns default capabilities of the classifier tree. |
void |
prune()
Prunes a tree using C4.5's pruning procedure. |
void |
setDescendents(java.util.ArrayList t,
C45PruneableClassifierTreeG originalLeaf)
add the grafted nodes at originalLeaf's position in tree. |
java.lang.String |
toString()
Prints tree structure. |
Methods inherited from class weka.classifiers.trees.j48.ClassifierTree |
---|
assignIDs, buildTree, buildTree, classifyInstance, cleanup, distributionForInstance, graph, graphType, numLeaves, numNodes, prefix, toSource |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public C45PruneableClassifierTreeG(ModelSelection toSelectLocModel, boolean pruneTree, float cf, boolean raiseTree, boolean relabel, boolean cleanup) throws java.lang.Exception
toSelectLocModel
- selection method for local splitting modelpruneTree
- true if the tree is to be prunedcf
- the confidence factor for pruningraiseTree
- cleanup
-
java.lang.Exception
- if something goes wrongpublic C45PruneableClassifierTreeG(ModelSelection toSelectLocModel, Instances data, ClassifierSplitModel gs, boolean prune, float cf, boolean raise, boolean isLeaf, boolean relabel, boolean cleanup)
toSelectLocModel
- selection method for local splitting modeldata
- the dta used to produce split modelgs
- the split modelprune
- true if the tree is to be prunedcf
- the confidence factor for pruningraise
- isLeaf
- if this node is a leaf or notrelabel
- whether relabeling occuredcleanup
-
java.lang.Exception
- if something goes wrongMethod Detail |
---|
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class ClassifierTree
Capabilities
public void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in class ClassifierTree
datathe
- data for building the tree
java.lang.Exception
- if something goes wrongpublic final void collapse()
public void prune() throws java.lang.Exception
java.lang.Exception
- if something goes wrongpublic void doGrafting(Instances data) throws java.lang.Exception
data
- the data for the tree
exception
- if anything goes wrong
java.lang.Exception
public void setDescendents(java.util.ArrayList t, C45PruneableClassifierTreeG originalLeaf)
t
- the list of nodes to graftoriginalLeaf
- the leaf that the grafts are replacingpublic double biprob(double x, double n, double r) throws java.lang.Exception
double
- x, double n, double r.
java.lang.Exception
public java.lang.String toString()
toString
in class ClassifierTree
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |