cc.mallet.classify
Class RankMaxEntTrainer

java.lang.Object
  extended by cc.mallet.classify.ClassifierTrainer<MaxEnt>
      extended by cc.mallet.classify.MaxEntTrainer
          extended by 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

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
RankMaxEntTrainer()
           
RankMaxEntTrainer(double gaussianPriorVariance)
          Constructs a trainer with a parameter to avoid overtraining.
 
Method Summary
 Optimizable.ByGradientValue getMaximizableTrainer(InstanceList ilist)
           
 java.lang.String toString()
          Like the other version of trainWithFeatureInduction, but allows some default options to be changed.
 MaxEnt train(InstanceList trainingSet)
           
 
Methods inherited from class cc.mallet.classify.MaxEntTrainer
getClassifier, getIteration, getOptimizable, getOptimizable, getOptimizable, getOptimizer, getOptimizer, setClassifier, setGaussianPriorVariance, setL1Weight, setNumIterations, train
 
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

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.

Method Detail

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