Package cc.mallet.classify
Class MaxEntGETrainer
- java.lang.Object
-
- cc.mallet.classify.ClassifierTrainer<MaxEnt>
-
- cc.mallet.classify.MaxEntGETrainer
-
- All Implemented Interfaces:
Boostable
,ClassifierTrainer.ByOptimization<MaxEnt>
,java.io.Serializable
public class MaxEntGETrainer 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
Fields Modifier and Type Field Description protected java.util.ArrayList<MaxEntGEConstraint>
constraints
-
Fields inherited from class cc.mallet.classify.ClassifierTrainer
finishedTraining, validationSet
-
-
Constructor Summary
Constructors Constructor Description MaxEntGETrainer()
MaxEntGETrainer(java.util.ArrayList<MaxEntGEConstraint> constraints)
MaxEntGETrainer(java.util.ArrayList<MaxEntGEConstraint> constraints, MaxEnt classifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MaxEnt
getClassifier()
int
getIteration()
Optimizable.ByGradientValue
getOptimizable(InstanceList trainingList)
Optimizer
getOptimizer()
void
setConstraintsFile(java.lang.String filename)
void
setGaussianPriorVariance(double variance)
void
setL2(boolean flag)
void
setMaxIterations(int iter)
Specifies the maximum number of iterations to run during a single call totrain
ortrainWithFeatureInduction
.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
-
-
-
-
Field Detail
-
constraints
protected java.util.ArrayList<MaxEntGEConstraint> constraints
-
-
Constructor Detail
-
MaxEntGETrainer
public MaxEntGETrainer()
-
MaxEntGETrainer
public MaxEntGETrainer(java.util.ArrayList<MaxEntGEConstraint> constraints)
-
MaxEntGETrainer
public MaxEntGETrainer(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 classClassifierTrainer<MaxEnt>
-
setUseValues
public void setUseValues(boolean flag)
-
setL2
public void setL2(boolean flag)
-
setNormalize
public void setNormalize(boolean normalize)
-
getOptimizable
public Optimizable.ByGradientValue getOptimizable(InstanceList trainingList)
-
getOptimizer
public Optimizer getOptimizer()
- Specified by:
getOptimizer
in interfaceClassifierTrainer.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 totrain
ortrainWithFeatureInduction
.
-
getIteration
public int getIteration()
- Specified by:
getIteration
in interfaceClassifierTrainer.ByOptimization<MaxEnt>
-
train
public MaxEnt train(InstanceList trainingList)
- Specified by:
train
in classClassifierTrainer<MaxEnt>
-
train
public MaxEnt train(InstanceList train, int maxIterations)
- Specified by:
train
in interfaceClassifierTrainer.ByOptimization<MaxEnt>
-
-