cc.mallet.classify
Class MCMaxEntTrainer
java.lang.Object
cc.mallet.classify.ClassifierTrainer<MCMaxEnt>
cc.mallet.classify.MCMaxEntTrainer
- All Implemented Interfaces:
- Boostable, java.io.Serializable
public class MCMaxEntTrainer
- extends ClassifierTrainer<MCMaxEnt>
- implements Boostable, java.io.Serializable
The trainer for a Maximum Entropy classifier.
- Author:
- Andrew McCallum mccallum@cs.umass.edu
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
EXP_GAIN
public static final java.lang.String EXP_GAIN
- See Also:
- Constant Field Values
GRADIENT_GAIN
public static final java.lang.String GRADIENT_GAIN
- See Also:
- Constant Field Values
INFORMATION_GAIN
public static final java.lang.String INFORMATION_GAIN
- See Also:
- Constant Field Values
MCMaxEntTrainer
public MCMaxEntTrainer(CommandOption.List col)
MCMaxEntTrainer
public MCMaxEntTrainer(MCMaxEnt initialClassifier)
MCMaxEntTrainer
public MCMaxEntTrainer()
MCMaxEntTrainer
public MCMaxEntTrainer(boolean useHyperbolicPrior)
MCMaxEntTrainer
public MCMaxEntTrainer(double gaussianPriorVariance)
- Constructs a trainer with a parameter to avoid overtraining. 1.0 is
usually a reasonable default value.
MCMaxEntTrainer
public MCMaxEntTrainer(double gaussianPriorVariance,
boolean useMultiConditionalTraining)
MCMaxEntTrainer
public MCMaxEntTrainer(double hyperbolicPriorSlope,
double hyperbolicPriorSharpness)
getCommandOptionList
public static CommandOption.List getCommandOptionList()
getMaximizableTrainer
public Optimizable.ByGradientValue getMaximizableTrainer(InstanceList ilist)
setNumIterations
public MCMaxEntTrainer setNumIterations(int i)
- Specifies the maximum number of iterations to run during a single call
to
train
or trainWithFeatureInduction
. Not
currently functional.
- Returns:
- This trainer
setUseHyperbolicPrior
public MCMaxEntTrainer setUseHyperbolicPrior(boolean useHyperbolicPrior)
setGaussianPriorVariance
public MCMaxEntTrainer setGaussianPriorVariance(double gaussianPriorVariance)
- Sets a parameter to prevent overtraining. A smaller variance for the prior
means that feature weights are expected to hover closer to 0, so extra
evidence is required to set a higher weight.
- Returns:
- This trainer
setHyperbolicPriorSlope
public MCMaxEntTrainer setHyperbolicPriorSlope(double hyperbolicPriorSlope)
setHyperbolicPriorSharpness
public MCMaxEntTrainer setHyperbolicPriorSharpness(double hyperbolicPriorSharpness)
getClassifier
public MCMaxEnt getClassifier()
- Specified by:
getClassifier
in class ClassifierTrainer<MCMaxEnt>
train
public MCMaxEnt train(InstanceList trainingSet)
- Specified by:
train
in class ClassifierTrainer<MCMaxEnt>
getValueGradientCalls
public int getValueGradientCalls()
- Counts how many times this trainer has computed the gradient of the
log probability of training labels.
getValueCalls
public int getValueCalls()
- Counts how many times this trainer has computed the
log probability of training labels.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object