Package cc.mallet.classify
Class ClassifierTrainer<C extends Classifier>
- java.lang.Object
-
- cc.mallet.classify.ClassifierTrainer<C>
-
- Direct Known Subclasses:
AdaBoostM2Trainer
,AdaBoostTrainer
,BaggingTrainer
,BalancedWinnowTrainer
,C45Trainer
,ClassifierEnsembleTrainer
,ConfidencePredictingClassifierTrainer
,DecisionTreeTrainer
,FeatureSelectingClassifierTrainer
,MaxEntGERangeTrainer
,MaxEntGETrainer
,MaxEntPRTrainer
,MaxEntTrainer
,MCMaxEntTrainer
,MostFrequentClassAssignmentTrainer
,NaiveBayesEMTrainer
,NaiveBayesTrainer
,RandomAssignmentTrainer
,WinnowTrainer
public abstract class ClassifierTrainer<C extends Classifier> extends java.lang.Object
Each ClassifierTrainer trains one Classifier based on various interfaces for consuming training data. If you want an object that can train be asked to train on multiple different training sets and yield different classifiers, you probably want a ClassifierTrainer.Factory.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ClassifierTrainer.ByActiveLearning<C extends Classifier>
For active learning, in which this trainer will select certain instances and request that the Labeler instance label them.static interface
ClassifierTrainer.ByIncrements<C extends Classifier>
For various kinds of online learning by batches, where training instances are presented, consumed for learning immediately.static interface
ClassifierTrainer.ByInstanceIncrements<C extends Classifier>
For online learning that can operate on one instance at a time.static interface
ClassifierTrainer.ByOptimization<C extends Classifier>
static class
ClassifierTrainer.Factory<CT extends ClassifierTrainer<? extends Classifier>>
Instances of a Factory know how to create new ClassifierTrainers to apply to new Classifiers.
-
Field Summary
Fields Modifier and Type Field Description protected boolean
finishedTraining
protected InstanceList
validationSet
-
Constructor Summary
Constructors Constructor Description ClassifierTrainer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract C
getClassifier()
InstanceList
getValidationInstances()
boolean
isFinishedTraining()
void
setValidationInstances(InstanceList validationSet)
abstract C
train(InstanceList trainingSet)
-
-
-
Field Detail
-
validationSet
protected InstanceList validationSet
-
finishedTraining
protected boolean finishedTraining
-
-
Method Detail
-
isFinishedTraining
public boolean isFinishedTraining()
-
getClassifier
public abstract C getClassifier()
-
train
public abstract C train(InstanceList trainingSet)
-
setValidationInstances
public void setValidationInstances(InstanceList validationSet)
-
getValidationInstances
public InstanceList getValidationInstances()
-
-