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 MaxEntgetClassifier()intgetNumParameters()doublegetParameter(int index)voidgetParameters(double[] buff)doublegetValue()Return the log probability of the training label distributionsintgetValueCalls()Counts how many times this trainer has computed the log probability of training labels.voidgetValueGradient(double[] buffer)intgetValueGradientCalls()Counts how many times this trainer has computed the gradient of the log probability of training labels.MaxEntOptimizableByLabelDistributionsetGaussianPriorVariance(double gaussianPriorVariance)Sets a parameter to prevent overtraining.voidsetParameter(int index, double v)voidsetParameters(double[] buff)MaxEntOptimizableByLabelDistributionuseGaussianPrior()
-
-
-
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:
getParameterin interfaceOptimizable
-
setParameter
public void setParameter(int index, double v)- Specified by:
setParameterin interfaceOptimizable
-
getNumParameters
public int getNumParameters()
- Specified by:
getNumParametersin interfaceOptimizable
-
getParameters
public void getParameters(double[] buff)
- Specified by:
getParametersin interfaceOptimizable
-
setParameters
public void setParameters(double[] buff)
- Specified by:
setParametersin interfaceOptimizable
-
getValue
public double getValue()
Return the log probability of the training label distributions- Specified by:
getValuein interfaceOptimizable.ByGradientValue
-
getValueGradient
public void getValueGradient(double[] buffer)
- Specified by:
getValueGradientin 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
-
-