weka.classifiers.j48
Class ClassifierDecList

java.lang.Object
  |
  +--weka.classifiers.j48.ClassifierDecList
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
C45PruneableDecList, PruneableDecList

public class ClassifierDecList
extends java.lang.Object
implements java.io.Serializable

Class for handling a rule (partial tree) for a decision list.

Author:
Eibe Frank (eibe@cs.waikato.ac.nz)
See Also:
Serialized Form

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  ClassifierDecList[] m_sons
          References to sons.
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)
          Constructor - just calls constructor of class DecList.
 
Method Summary
 void buildDecList(Instances data, boolean leaf)
          Builds the partial tree without hold out set.
 void buildDecList(Instances train, Instances test, boolean leaf)
          Builds the partial tree with hold out set
protected  int chooseIndex()
          Dummy method.
protected  int chooseLastIndex()
          Dummy method.
 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.
protected  ClassifierDecList getNewDecList(Instances train, boolean leaf)
          Returns a newly created tree.
protected  ClassifierDecList getNewDecList(Instances train, Instances test, boolean leaf)
          Returns a newly created tree.
protected  void pruneEnd()
          Dummy method.
 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

m_toSelectModel

protected ModelSelection m_toSelectModel
The model selection method.

m_localModel

protected ClassifierSplitModel m_localModel
Local model at node.

m_sons

protected ClassifierDecList[] m_sons
References to sons.

m_isLeaf

protected boolean m_isLeaf
True if node is leaf.

m_isEmpty

protected boolean m_isEmpty
True if node is empty.

m_train

protected Instances m_train
The training instances.

m_test

protected Distribution m_test
The pruning instances.

indeX

protected int indeX
Which son to expand?
Constructor Detail

ClassifierDecList

public ClassifierDecList(ModelSelection toSelectLocModel)
Constructor - just calls constructor of class DecList.
Method Detail

buildDecList

public void buildDecList(Instances data,
                         boolean leaf)
                  throws java.lang.Exception
Builds the partial tree without hold out set.
Throws:
java.lang.Exception - if something goes wrong

buildDecList

public void buildDecList(Instances train,
                         Instances test,
                         boolean leaf)
                  throws java.lang.Exception
Builds the partial tree with hold out set
Throws:
java.lang.Exception - if something goes wrong

classifyInstance

public double classifyInstance(Instance instance)
                        throws java.lang.Exception
Classifies an instance.
Throws:
java.lang.Exception - if something goes wrong

distributionForInstance

public final double[] distributionForInstance(Instance instance)
                                       throws java.lang.Exception
Returns class probabilities for a weighted instance.
Throws:
java.lang.Exception - if something goes wrong

weight

public double weight(Instance instance)
              throws java.lang.Exception
Returns the weight a rule assigns to an instance.
Throws:
java.lang.Exception - if something goes wrong

cleanup

public final void cleanup(Instances justHeaderInfo)
Cleanup in order to save memory.

toString

public java.lang.String toString()
Prints rules.
Overrides:
toString in class java.lang.Object

getNewDecList

protected ClassifierDecList getNewDecList(Instances train,
                                          boolean leaf)
                                   throws java.lang.Exception
Returns a newly created tree.
Throws:
java.lang.Exception - if something goes wrong

getNewDecList

protected ClassifierDecList getNewDecList(Instances train,
                                          Instances test,
                                          boolean leaf)
                                   throws java.lang.Exception
Returns a newly created tree.
Throws:
java.lang.Exception - if something goes wrong

chooseLastIndex

protected int chooseLastIndex()
Dummy method. Overwritten by sub classes.

chooseIndex

protected int chooseIndex()
Dummy method. Overwritten by sub classes.

pruneEnd

protected void pruneEnd()
                 throws java.lang.Exception
Dummy method. Overwritten by sub classes.