weka.classifiers.rules.part
Class PruneableDecList

java.lang.Object
  extended byweka.classifiers.rules.part.ClassifierDecList
      extended byweka.classifiers.rules.part.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.

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

Field Summary
 
Fields inherited from class weka.classifiers.rules.part.ClassifierDecList
indeX, m_isEmpty, m_isLeaf, m_localModel, m_minNumObj, m_sons, m_splitCrit, m_test, m_toSelectModel, m_train
 
Constructor Summary
PruneableDecList(ModelSelection toSelectLocModel, int minNum)
          Constructor for pruneable partial tree structure.
 
Method Summary
 void buildDecList(Instances train, Instances test, boolean leaf)
          Builds the partial tree with hold out set
 void buildRule(Instances train, Instances test)
          Method for building a pruned partial tree.
private  double errorsForLeaf()
          Computes estimated errors for leaf.
private  double errorsForTree()
          Computes error estimate for tree.
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.rules.part.ClassifierDecList
buildDecList, buildRule, chooseIndex, chooseLastIndex, classifyInstance, cleanup, distributionForInstance, getNewDecList, getSizeOfBranch, localModel, son, 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

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

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

pruneEnd

protected void pruneEnd()
                 throws java.lang.Exception
Prunes the end of the rule.

Throws:
java.lang.Exception

errorsForTree

private double errorsForTree()
                      throws java.lang.Exception
Computes error estimate for tree.

Throws:
java.lang.Exception

errorsForLeaf

private double errorsForLeaf()
                      throws java.lang.Exception
Computes estimated errors for leaf.

Throws:
java.lang.Exception