cc.mallet.classify
Class MaxEntPRTrainer

java.lang.Object
  extended by cc.mallet.classify.ClassifierTrainer<MaxEnt>
      extended by cc.mallet.classify.MaxEntPRTrainer
All Implemented Interfaces:
ClassifierTrainer.ByOptimization<MaxEnt>

public class MaxEntPRTrainer
extends ClassifierTrainer<MaxEnt>
implements ClassifierTrainer.ByOptimization<MaxEnt>

Penalty (soft) version of Posterior Regularization (PR) for training MaxEnt.

Author:
Gregory Druck gdruck@cs.umass.edu

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
MaxEntPRTrainer()
           
MaxEntPRTrainer(java.util.ArrayList<MaxEntPRConstraint> constraints)
           
 
Method Summary
 MaxEnt getClassifier()
           
 int getIteration()
           
 Optimizer getOptimizer()
           
 boolean isFinishedTraining()
           
 void setConstraintsFile(java.lang.String filename)
           
 void setMaxIterations(int minIterations)
           
 void setMinIterations(int minIterations)
           
 void setNormalize(boolean normalize)
           
 void setPGaussianPriorVariance(double pGPV)
           
 void setQGaussianPriorVariance(double qGPV)
           
 void setUseValues(boolean flag)
           
 MaxEnt train(InstanceList trainingSet)
           
 MaxEnt train(InstanceList trainingSet, int maxIterations)
           
 MaxEnt train(InstanceList data, int minIterations, int maxIterations)
           
 
Methods inherited from class cc.mallet.classify.ClassifierTrainer
getValidationInstances, setValidationInstances
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaxEntPRTrainer

public MaxEntPRTrainer()

MaxEntPRTrainer

public MaxEntPRTrainer(java.util.ArrayList<MaxEntPRConstraint> constraints)
Method Detail

setPGaussianPriorVariance

public void setPGaussianPriorVariance(double pGPV)

setQGaussianPriorVariance

public void setQGaussianPriorVariance(double qGPV)

setConstraintsFile

public void setConstraintsFile(java.lang.String filename)

setUseValues

public void setUseValues(boolean flag)

setMinIterations

public void setMinIterations(int minIterations)

setMaxIterations

public void setMaxIterations(int minIterations)

setNormalize

public void setNormalize(boolean normalize)

getOptimizer

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

getIteration

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

isFinishedTraining

public boolean isFinishedTraining()
Overrides:
isFinishedTraining in class ClassifierTrainer<MaxEnt>

getClassifier

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

train

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

train

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

train

public MaxEnt train(InstanceList data,
                    int minIterations,
                    int maxIterations)