weka.classifiers.j48
Class PruneableDecList

java.lang.Object
  |
  +--weka.classifiers.j48.ClassifierDecList
        |
        +--weka.classifiers.j48.PruneableDecList
All Implemented Interfaces:
java.io.Serializable

public class PruneableDecList
extends ClassifierDecList

Class for handling a partial tree structure that can be pruned using a pruning set.

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

Fields inherited from class weka.classifiers.j48.ClassifierDecList
indeX, m_isEmpty, m_isLeaf, m_localModel, m_sons, m_test, m_toSelectModel, m_train
 
Constructor Summary
PruneableDecList(ModelSelection toSelectLocModel, int minNum)
          Constructor for pruneable partial tree structure.
 
Method Summary
 void buildRule(Instances train, Instances test)
          Method for building a pruned partial tree.
 int chooseIndex()
          Method for choosing a subset to expand.
 int chooseLastIndex()
          Choose last index (ie.
protected  ClassifierDecList getNewDecList(Instances train, Instances test, boolean leaf)
          Returns a newly created tree.
protected  void pruneEnd()
          Prunes the end of the rule.
 
Methods inherited from class weka.classifiers.j48.ClassifierDecList
buildDecList, buildDecList, classifyInstance, cleanup, distributionForInstance, getNewDecList, toString, weight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PruneableDecList

public PruneableDecList(ModelSelection toSelectLocModel,
                        int minNum)
Constructor for pruneable partial tree structure.
Parameters:
toSelectLocModel - selection method for local splitting model
minNum - minimum number of objects in leaf
Method Detail

buildRule

public void buildRule(Instances train,
                      Instances test)
               throws java.lang.Exception
Method for building a pruned partial tree.
Throws:
java.lang.Exception - if tree can't be built successfully

chooseIndex

public final int chooseIndex()
Method for choosing a subset to expand.
Overrides:
chooseIndex in class ClassifierDecList

chooseLastIndex

public final int chooseLastIndex()
Choose last index (ie. choose rule).
Overrides:
chooseLastIndex in class ClassifierDecList

getNewDecList

protected ClassifierDecList getNewDecList(Instances train,
                                          Instances test,
                                          boolean leaf)
                                   throws java.lang.Exception
Returns a newly created tree.
Overrides:
getNewDecList in class ClassifierDecList
Parameters:
data - and selection method for local models.
Throws:
java.lang.Exception - if something goes wrong

pruneEnd

protected void pruneEnd()
                 throws java.lang.Exception
Prunes the end of the rule.
Overrides:
pruneEnd in class ClassifierDecList