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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MaxEntOptimizableByLabelDistribution
public MaxEntOptimizableByLabelDistribution()
MaxEntOptimizableByLabelDistribution
public MaxEntOptimizableByLabelDistribution(InstanceList trainingSet,
MaxEnt initialClassifier)
getClassifier
public MaxEnt getClassifier()
getParameter
public double getParameter(int index)
- Specified by:
getParameter
in interface Optimizable
setParameter
public void setParameter(int index,
double v)
- Specified by:
setParameter
in interface Optimizable
getNumParameters
public int getNumParameters()
- Specified by:
getNumParameters
in interface Optimizable
getParameters
public void getParameters(double[] buff)
- Specified by:
getParameters
in interface Optimizable
setParameters
public void setParameters(double[] buff)
- Specified by:
setParameters
in interface Optimizable
getValue
public double getValue()
- Return the log probability of the training label distributions
- Specified by:
getValue
in interface Optimizable.ByGradientValue
getValueGradient
public void getValueGradient(double[] buffer)
- Specified by:
getValueGradient
in interface Optimizable.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