Package cc.mallet.classify
Class DecisionTreeTrainer
- java.lang.Object
-
- cc.mallet.classify.ClassifierTrainer<DecisionTree>
-
- 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
Nested Classes Modifier and Type Class Description 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
Fields Modifier and Type Field Description static int
DEFAULT_MAX_DEPTH
static double
DEFAULT_MIN_INFO_GAIN_SPLIT
-
Fields inherited from class cc.mallet.classify.ClassifierTrainer
finishedTraining, validationSet
-
-
Constructor Summary
Constructors Constructor Description DecisionTreeTrainer()
DecisionTreeTrainer(int maxDepth)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
-
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
-
-
Method Detail
-
setMaxDepth
public DecisionTreeTrainer setMaxDepth(int maxDepth)
-
setMinInfoGainSplit
public DecisionTreeTrainer setMinInfoGainSplit(double m)
-
isFinishedTraining
public boolean isFinishedTraining()
- Overrides:
isFinishedTraining
in classClassifierTrainer<DecisionTree>
-
getClassifier
public DecisionTree getClassifier()
- Specified by:
getClassifier
in classClassifierTrainer<DecisionTree>
-
train
public DecisionTree train(InstanceList trainingList)
- Specified by:
train
in classClassifierTrainer<DecisionTree>
-
splitTree
protected void splitTree(DecisionTree.Node node, FeatureSelection selectedFeatures, int depth)
-
-