Package cc.mallet.classify
Class MaxEntPRTrainer
- java.lang.Object
-
- cc.mallet.classify.ClassifierTrainer<MaxEnt>
-
- 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
Constructors Constructor Description MaxEntPRTrainer()
MaxEntPRTrainer(java.util.ArrayList<MaxEntPRConstraint> constraints)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
-
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 interfaceClassifierTrainer.ByOptimization<MaxEnt>
-
getIteration
public int getIteration()
- Specified by:
getIteration
in interfaceClassifierTrainer.ByOptimization<MaxEnt>
-
isFinishedTraining
public boolean isFinishedTraining()
- Overrides:
isFinishedTraining
in classClassifierTrainer<MaxEnt>
-
getClassifier
public MaxEnt getClassifier()
- Specified by:
getClassifier
in classClassifierTrainer<MaxEnt>
-
train
public MaxEnt train(InstanceList trainingSet)
- Specified by:
train
in classClassifierTrainer<MaxEnt>
-
train
public MaxEnt train(InstanceList trainingSet, int maxIterations)
- Specified by:
train
in interfaceClassifierTrainer.ByOptimization<MaxEnt>
-
train
public MaxEnt train(InstanceList data, int minIterations, int maxIterations)
-
-