cc.mallet.classify
Class MaxEntGERangeTrainer

java.lang.Object
  extended by cc.mallet.classify.ClassifierTrainer<MaxEnt>
      extended by cc.mallet.classify.MaxEntGERangeTrainer
All Implemented Interfaces:
Boostable, ClassifierTrainer.ByOptimization<MaxEnt>, java.io.Serializable

public class MaxEntGERangeTrainer
extends ClassifierTrainer<MaxEnt>
implements ClassifierTrainer.ByOptimization<MaxEnt>, Boostable, java.io.Serializable

Training of MaxEnt models with labeled features using Generalized Expectation Criteria. Based on: "Learning from Labeled Features using Generalized Expectation Criteria" Gregory Druck, Gideon Mann, Andrew McCallum SIGIR 2008

Author:
Gregory Druck gdruck@cs.umass.edu Better explanations of parameters is given in MaxEntOptimizableByGE
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
protected  java.util.ArrayList<MaxEntGEConstraint> constraints
           
 
Fields inherited from class cc.mallet.classify.ClassifierTrainer
finishedTraining, validationSet
 
Constructor Summary
MaxEntGERangeTrainer()
           
MaxEntGERangeTrainer(java.util.ArrayList<MaxEntGEConstraint> constraints)
           
MaxEntGERangeTrainer(java.util.ArrayList<MaxEntGEConstraint> constraints, MaxEnt classifier)
           
 
Method Summary
 MaxEnt getClassifier()
           
 int getIteration()
           
 Optimizable.ByGradientValue getOptimizable(InstanceList trainingList)
           
 Optimizer getOptimizer()
           
 void setConstraintsFile(java.lang.String filename)
           
 void setGaussianPriorVariance(double variance)
           
 void setMaxIterations(int iter)
          Specifies the maximum number of iterations to run during a single call to train or trainWithFeatureInduction.
 void setNormalize(boolean normalize)
           
 void setOptimizer(Optimizer opt)
           
 void setTemperature(double temp)
           
 void setUseValues(boolean flag)
           
 MaxEnt train(InstanceList trainingList)
           
 MaxEnt train(InstanceList train, int maxIterations)
           
 
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, toString, wait, wait, wait
 

Field Detail

constraints

protected java.util.ArrayList<MaxEntGEConstraint> constraints
Constructor Detail

MaxEntGERangeTrainer

public MaxEntGERangeTrainer()

MaxEntGERangeTrainer

public MaxEntGERangeTrainer(java.util.ArrayList<MaxEntGEConstraint> constraints)

MaxEntGERangeTrainer

public MaxEntGERangeTrainer(java.util.ArrayList<MaxEntGEConstraint> constraints,
                            MaxEnt classifier)
Method Detail

setConstraintsFile

public void setConstraintsFile(java.lang.String filename)

setTemperature

public void setTemperature(double temp)

setGaussianPriorVariance

public void setGaussianPriorVariance(double variance)

getClassifier

public MaxEnt getClassifier()
Specified by:
getClassifier in class ClassifierTrainer<MaxEnt>

setUseValues

public void setUseValues(boolean flag)

setNormalize

public void setNormalize(boolean normalize)

getOptimizable

public Optimizable.ByGradientValue getOptimizable(InstanceList trainingList)

getOptimizer

public Optimizer getOptimizer()
Specified by:
getOptimizer in interface ClassifierTrainer.ByOptimization<MaxEnt>

setOptimizer

public void setOptimizer(Optimizer opt)

setMaxIterations

public void setMaxIterations(int iter)
Specifies the maximum number of iterations to run during a single call to train or trainWithFeatureInduction.


getIteration

public int getIteration()
Specified by:
getIteration in interface ClassifierTrainer.ByOptimization<MaxEnt>

train

public MaxEnt train(InstanceList trainingList)
Specified by:
train in class ClassifierTrainer<MaxEnt>

train

public MaxEnt train(InstanceList train,
                    int maxIterations)
Specified by:
train in interface ClassifierTrainer.ByOptimization<MaxEnt>