cc.mallet.classify
Class RankMaxEntTrainer
java.lang.Object
cc.mallet.classify.ClassifierTrainer<MaxEnt>
cc.mallet.classify.MaxEntTrainer
cc.mallet.classify.RankMaxEntTrainer
- All Implemented Interfaces:
- Boostable, ClassifierTrainer.ByOptimization<MaxEnt>, java.io.Serializable
public class RankMaxEntTrainer
- extends MaxEntTrainer
The trainer for a RankMaxEnt
classifier. Expects Instance data to be a
FeatureVectorSequence, and the target to be a String representation of the
index of the true best FeatureVectorSequence. Note that the Instance target
may be a Labels to indicate a tie for the best Instance.
- Author:
- Aron Culotta culotta@cs.umass.edu
- See Also:
- Serialized Form
Methods inherited from class cc.mallet.classify.MaxEntTrainer |
getClassifier, getIteration, getOptimizable, getOptimizable, getOptimizable, getOptimizer, getOptimizer, setClassifier, setGaussianPriorVariance, setL1Weight, setNumIterations, train |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RankMaxEntTrainer
public RankMaxEntTrainer()
RankMaxEntTrainer
public RankMaxEntTrainer(double gaussianPriorVariance)
- Constructs a trainer with a parameter to avoid overtraining. 1.0 is
usually a reasonable default value.
getMaximizableTrainer
public Optimizable.ByGradientValue getMaximizableTrainer(InstanceList ilist)
train
public MaxEnt train(InstanceList trainingSet)
- Overrides:
train
in class MaxEntTrainer
toString
public java.lang.String toString()
Like the other version of trainWithFeatureInduction
, but
allows some default options to be changed.
- Overrides:
toString
in class MaxEntTrainer
- Parameters:
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
).
- Returns:
- The trained
MaxEnt
classifier