|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cc.mallet.classify.ClassifierTrainer<MaxEnt> cc.mallet.classify.MaxEntTrainer
public class MaxEntTrainer
The trainer for a Maximum Entropy classifier.
Nested Class Summary |
---|
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>, ClassifierTrainer.Factory<CT extends ClassifierTrainer<? extends Classifier>> |
Field Summary |
---|
Fields inherited from class cc.mallet.classify.ClassifierTrainer |
---|
finishedTraining, validationSet |
Constructor Summary | |
---|---|
MaxEntTrainer()
|
|
MaxEntTrainer(double gaussianPriorVariance)
Constructs a trainer with a parameter to avoid overtraining. |
|
MaxEntTrainer(MaxEnt theClassifierToTrain)
Construct a MaxEnt trainer using a trained classifier as initial values. |
Method Summary | |
---|---|
MaxEnt |
getClassifier()
|
int |
getIteration()
|
Optimizable |
getOptimizable()
|
MaxEntOptimizableByLabelLikelihood |
getOptimizable(InstanceList trainingSet)
|
MaxEntOptimizableByLabelLikelihood |
getOptimizable(InstanceList trainingSet,
MaxEnt initialClassifier)
|
Optimizer |
getOptimizer()
|
Optimizer |
getOptimizer(InstanceList trainingSet)
This method is called by the train method. |
void |
setClassifier(MaxEnt theClassifierToTrain)
Initialize parameters using the provided classifier. |
MaxEntTrainer |
setGaussianPriorVariance(double gaussianPriorVariance)
Sets a parameter to prevent overtraining. |
MaxEntTrainer |
setL1Weight(double l1Weight)
Use an L1 prior. |
MaxEntTrainer |
setNumIterations(int i)
Specifies the maximum number of iterations to run during a single call to train or trainWithFeatureInduction . |
java.lang.String |
toString()
Like the other version of trainWithFeatureInduction , but
allows some default options to be changed. |
MaxEnt |
train(InstanceList trainingSet)
|
MaxEnt |
train(InstanceList trainingSet,
int numIterations)
|
Methods inherited from class cc.mallet.classify.ClassifierTrainer |
---|
getValidationInstances, isFinishedTraining, setValidationInstances |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MaxEntTrainer()
public MaxEntTrainer(MaxEnt theClassifierToTrain)
public MaxEntTrainer(double gaussianPriorVariance)
Method Detail |
---|
public MaxEnt getClassifier()
getClassifier
in class ClassifierTrainer<MaxEnt>
public void setClassifier(MaxEnt theClassifierToTrain)
public Optimizable getOptimizable()
public MaxEntOptimizableByLabelLikelihood getOptimizable(InstanceList trainingSet)
public MaxEntOptimizableByLabelLikelihood getOptimizable(InstanceList trainingSet, MaxEnt initialClassifier)
public Optimizer getOptimizer()
getOptimizer
in interface ClassifierTrainer.ByOptimization<MaxEnt>
public Optimizer getOptimizer(InstanceList trainingSet)
public MaxEntTrainer setNumIterations(int i)
train
or trainWithFeatureInduction
. Not
currently functional.
public int getIteration()
getIteration
in interface ClassifierTrainer.ByOptimization<MaxEnt>
public MaxEntTrainer setGaussianPriorVariance(double gaussianPriorVariance)
public MaxEntTrainer setL1Weight(double l1Weight)
public MaxEnt train(InstanceList trainingSet)
train
in class ClassifierTrainer<MaxEnt>
public MaxEnt train(InstanceList trainingSet, int numIterations)
train
in interface ClassifierTrainer.ByOptimization<MaxEnt>
public java.lang.String toString()
Like the other version of trainWithFeatureInduction
, but
allows some default options to be changed.
toString
in class java.lang.Object
maxent
- An initial partially-trained classifier (default null
).
This classifier may be modified during training.gainName
- The estimate of gain (log-likelihood increase) we want our chosen
features to maximize.
Should be one of MaxEntTrainer.EXP_GAIN
,
MaxEntTrainer.GRADIENT_GAIN
, or
MaxEntTrainer.INFORMATION_GAIN
(default EXP_GAIN
).
MaxEnt
classifier
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |