|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.rules.part.ClassifierDecList
Class for handling a rule (partial tree) for a decision list.
Field Summary | |
protected int |
indeX
Which son to expand? |
protected boolean |
m_isEmpty
True if node is empty. |
protected boolean |
m_isLeaf
True if node is leaf. |
protected ClassifierSplitModel |
m_localModel
Local model at node. |
protected int |
m_minNumObj
Minimum number of objects |
protected ClassifierDecList[] |
m_sons
References to sons. |
protected static EntropySplitCrit |
m_splitCrit
To compute the entropy. |
protected Distribution |
m_test
The pruning instances. |
protected ModelSelection |
m_toSelectModel
The model selection method. |
protected Instances |
m_train
The training instances. |
Constructor Summary | |
ClassifierDecList(ModelSelection toSelectLocModel,
int minNum)
Constructor - just calls constructor of class DecList. |
Method Summary | |
void |
buildDecList(Instances data,
boolean leaf)
Builds the partial tree without hold out set. |
void |
buildRule(Instances data)
Method for building a pruned partial tree. |
int |
chooseIndex()
Method for choosing a subset to expand. |
int |
chooseLastIndex()
Choose last index (ie. choose rule). |
double |
classifyInstance(Instance instance)
Classifies an instance. |
void |
cleanup(Instances justHeaderInfo)
Cleanup in order to save memory. |
double[] |
distributionForInstance(Instance instance)
Returns class probabilities for a weighted instance. |
private void |
dumpDecList(java.lang.StringBuffer text)
Help method for printing tree structure. |
private void |
dumpTree(int depth,
java.lang.StringBuffer text)
Dumps the partial tree (only used for debugging) |
protected ClassifierDecList |
getNewDecList(Instances train,
boolean leaf)
Returns a newly created tree. |
private double |
getProbs(int classIndex,
Instance instance,
double weight)
Help method for computing class probabilities of a given instance. |
protected double |
getSizeOfBranch()
Returns the number of instances covered by a branch |
protected ClassifierSplitModel |
localModel()
Method just exists to make program easier to read. |
protected ClassifierDecList |
son(int index)
Method just exists to make program easier to read. |
java.lang.String |
toString()
Prints rules. |
double |
weight(Instance instance)
Returns the weight a rule assigns to an instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int m_minNumObj
protected static EntropySplitCrit m_splitCrit
protected ModelSelection m_toSelectModel
protected ClassifierSplitModel m_localModel
protected ClassifierDecList[] m_sons
protected boolean m_isLeaf
protected boolean m_isEmpty
protected Instances m_train
protected Distribution m_test
protected int indeX
Constructor Detail |
public ClassifierDecList(ModelSelection toSelectLocModel, int minNum)
Method Detail |
public void buildRule(Instances data) throws java.lang.Exception
java.lang.Exception
- if something goes wrongpublic void buildDecList(Instances data, boolean leaf) throws java.lang.Exception
java.lang.Exception
- if something goes wrongpublic double classifyInstance(Instance instance) throws java.lang.Exception
java.lang.Exception
- if something goes wrongpublic final double[] distributionForInstance(Instance instance) throws java.lang.Exception
java.lang.Exception
- if something goes wrongpublic double weight(Instance instance) throws java.lang.Exception
java.lang.Exception
- if something goes wrongpublic final void cleanup(Instances justHeaderInfo)
public java.lang.String toString()
protected ClassifierDecList getNewDecList(Instances train, boolean leaf) throws java.lang.Exception
java.lang.Exception
- if something goes wrongpublic final int chooseIndex()
public final int chooseLastIndex()
protected double getSizeOfBranch()
private void dumpDecList(java.lang.StringBuffer text) throws java.lang.Exception
java.lang.Exception
private void dumpTree(int depth, java.lang.StringBuffer text) throws java.lang.Exception
exception
- Exception if something goes wrong
java.lang.Exception
private double getProbs(int classIndex, Instance instance, double weight) throws java.lang.Exception
exception
- Exception if something goes wrong
java.lang.Exception
protected ClassifierSplitModel localModel()
protected ClassifierDecList son(int index)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |