Package cc.mallet.classify
Class MaxEntOptimizableByLabelDistribution
- java.lang.Object
-
- cc.mallet.classify.MaxEntOptimizableByLabelDistribution
-
- All Implemented Interfaces:
Optimizable
,Optimizable.ByGradientValue
public class MaxEntOptimizableByLabelDistribution extends java.lang.Object implements Optimizable.ByGradientValue
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface cc.mallet.optimize.Optimizable
Optimizable.ByBatchGradient, Optimizable.ByCombiningBatchGradient, Optimizable.ByGISUpdate, Optimizable.ByGradient, Optimizable.ByGradientValue, Optimizable.ByHessian, Optimizable.ByValue, Optimizable.ByVotedPerceptron
-
-
Constructor Summary
Constructors Constructor Description MaxEntOptimizableByLabelDistribution()
MaxEntOptimizableByLabelDistribution(InstanceList trainingSet, MaxEnt initialClassifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MaxEnt
getClassifier()
int
getNumParameters()
double
getParameter(int index)
void
getParameters(double[] buff)
double
getValue()
Return the log probability of the training label distributionsint
getValueCalls()
Counts how many times this trainer has computed the log probability of training labels.void
getValueGradient(double[] buffer)
int
getValueGradientCalls()
Counts how many times this trainer has computed the gradient of the log probability of training labels.MaxEntOptimizableByLabelDistribution
setGaussianPriorVariance(double gaussianPriorVariance)
Sets a parameter to prevent overtraining.void
setParameter(int index, double v)
void
setParameters(double[] buff)
MaxEntOptimizableByLabelDistribution
useGaussianPrior()
-
-
-
Constructor Detail
-
MaxEntOptimizableByLabelDistribution
public MaxEntOptimizableByLabelDistribution()
-
MaxEntOptimizableByLabelDistribution
public MaxEntOptimizableByLabelDistribution(InstanceList trainingSet, MaxEnt initialClassifier)
-
-
Method Detail
-
getClassifier
public MaxEnt getClassifier()
-
getParameter
public double getParameter(int index)
- Specified by:
getParameter
in interfaceOptimizable
-
setParameter
public void setParameter(int index, double v)
- Specified by:
setParameter
in interfaceOptimizable
-
getNumParameters
public int getNumParameters()
- Specified by:
getNumParameters
in interfaceOptimizable
-
getParameters
public void getParameters(double[] buff)
- Specified by:
getParameters
in interfaceOptimizable
-
setParameters
public void setParameters(double[] buff)
- Specified by:
setParameters
in interfaceOptimizable
-
getValue
public double getValue()
Return the log probability of the training label distributions- Specified by:
getValue
in interfaceOptimizable.ByGradientValue
-
getValueGradient
public void getValueGradient(double[] buffer)
- Specified by:
getValueGradient
in interfaceOptimizable.ByGradientValue
-
getValueGradientCalls
public int getValueGradientCalls()
Counts how many times this trainer has computed the gradient of the log probability of training labels.
-
getValueCalls
public int getValueCalls()
Counts how many times this trainer has computed the log probability of training labels.
-
useGaussianPrior
public MaxEntOptimizableByLabelDistribution useGaussianPrior()
-
setGaussianPriorVariance
public MaxEntOptimizableByLabelDistribution setGaussianPriorVariance(double gaussianPriorVariance)
Sets a parameter to prevent overtraining. A smaller variance for the prior means that feature weights are expected to hover closer to 0, so extra evidence is required to set a higher weight.- Returns:
- This trainer
-
-