cc.mallet.classify
Class DecisionTreeTrainer

java.lang.Object
  extended by cc.mallet.classify.ClassifierTrainer<DecisionTree>
      extended by cc.mallet.classify.DecisionTreeTrainer
All Implemented Interfaces:
Boostable

public class DecisionTreeTrainer
extends ClassifierTrainer<DecisionTree>
implements Boostable

A decision tree learner, roughly ID3, but only to a fixed given depth in all branches. Does not yet implement splitting of continuous-valued features, but it should in the future. Currently a feature is considered "present" if it has positive value. ftp://ftp.cs.cmu.edu/project/jair/volume4/quinlan96a.ps Only set up for conveniently learning decision stubs: there is no pruning or good stopping rule. Currently only stop by reaching a maximum depth.

Author:
Andrew McCallum mccallum@cs.umass.edu

Nested Class Summary
static class DecisionTreeTrainer.Factory
           
 
Nested classes/interfaces inherited from class cc.mallet.classify.ClassifierTrainer
ClassifierTrainer.ByActiveLearning<C extends Classifier>, ClassifierTrainer.ByIncrements<C extends Classifier>, ClassifierTrainer.ByInstanceIncrements<C extends Classifier>, ClassifierTrainer.ByOptimization<C extends Classifier>
 
Field Summary
static int DEFAULT_MAX_DEPTH
           
static double DEFAULT_MIN_INFO_GAIN_SPLIT
           
 
Fields inherited from class cc.mallet.classify.ClassifierTrainer
finishedTraining, validationSet
 
Constructor Summary
DecisionTreeTrainer()
           
DecisionTreeTrainer(int maxDepth)
           
 
Method Summary
 DecisionTree getClassifier()
           
 boolean isFinishedTraining()
           
 DecisionTreeTrainer setMaxDepth(int maxDepth)
           
 DecisionTreeTrainer setMinInfoGainSplit(double m)
           
protected  void splitTree(DecisionTree.Node node, FeatureSelection selectedFeatures, int depth)
           
 DecisionTree train(InstanceList trainingList)
           
 
Methods inherited from class cc.mallet.classify.ClassifierTrainer
getValidationInstances, setValidationInstances
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_DEPTH

public static final int DEFAULT_MAX_DEPTH
See Also:
Constant Field Values

DEFAULT_MIN_INFO_GAIN_SPLIT

public static final double DEFAULT_MIN_INFO_GAIN_SPLIT
See Also:
Constant Field Values
Constructor Detail

DecisionTreeTrainer

public DecisionTreeTrainer(int maxDepth)

DecisionTreeTrainer

public DecisionTreeTrainer()
Method Detail

setMaxDepth

public DecisionTreeTrainer setMaxDepth(int maxDepth)

setMinInfoGainSplit

public DecisionTreeTrainer setMinInfoGainSplit(double m)

isFinishedTraining

public boolean isFinishedTraining()
Overrides:
isFinishedTraining in class ClassifierTrainer<DecisionTree>

getClassifier

public DecisionTree getClassifier()
Specified by:
getClassifier in class ClassifierTrainer<DecisionTree>

train

public DecisionTree train(InstanceList trainingList)
Specified by:
train in class ClassifierTrainer<DecisionTree>

splitTree

protected void splitTree(DecisionTree.Node node,
                         FeatureSelection selectedFeatures,
                         int depth)