cc.mallet.classify
Class MaxEnt
java.lang.Object
cc.mallet.classify.Classifier
cc.mallet.classify.MaxEnt
- All Implemented Interfaces:
- AlphabetCarrying, java.io.Serializable
- Direct Known Subclasses:
- RankMaxEnt
public class MaxEnt
- extends Classifier
- implements java.io.Serializable
Maximum Entropy (AKA Multivariate Logistic Regression) classifier.
- Author:
- Andrew McCallum mccallum@cs.umass.edu
- See Also:
- Serialized Form
Methods inherited from class cc.mallet.classify.Classifier |
alphabetsMatch, classify, classify, classify, getAccuracy, getAlphabet, getAlphabets, getAverageRank, getF1, getF1, getF1, getInstancePipe, getLabelAlphabet, getPrecision, getPrecision, getPrecision, getRecall, getRecall, getRecall, print |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
parameters
protected double[] parameters
defaultFeatureIndex
protected int defaultFeatureIndex
featureSelection
protected FeatureSelection featureSelection
perClassFeatureSelection
protected FeatureSelection[] perClassFeatureSelection
MaxEnt
public MaxEnt(Pipe dataPipe,
double[] parameters,
FeatureSelection featureSelection,
FeatureSelection[] perClassFeatureSelection)
MaxEnt
public MaxEnt(Pipe dataPipe,
double[] parameters,
FeatureSelection featureSelection)
MaxEnt
public MaxEnt(Pipe dataPipe,
double[] parameters,
FeatureSelection[] perClassFeatureSelection)
MaxEnt
public MaxEnt(Pipe dataPipe,
double[] parameters)
getParameters
public double[] getParameters()
getNumParameters
public int getNumParameters()
getNumParameters
public static int getNumParameters(Pipe instancePipe)
setParameters
public void setParameters(double[] parameters)
setParameter
public void setParameter(int classIndex,
int featureIndex,
double value)
getFeatureSelection
public FeatureSelection getFeatureSelection()
- Overrides:
getFeatureSelection
in class Classifier
setFeatureSelection
public MaxEnt setFeatureSelection(FeatureSelection fs)
getPerClassFeatureSelection
public FeatureSelection[] getPerClassFeatureSelection()
- Overrides:
getPerClassFeatureSelection
in class Classifier
setPerClassFeatureSelection
public MaxEnt setPerClassFeatureSelection(FeatureSelection[] fss)
getDefaultFeatureIndex
public int getDefaultFeatureIndex()
setDefaultFeatureIndex
public void setDefaultFeatureIndex(int defaultFeatureIndex)
getUnnormalizedClassificationScores
public void getUnnormalizedClassificationScores(Instance instance,
double[] scores)
getClassificationScores
public void getClassificationScores(Instance instance,
double[] scores)
getClassificationScoresWithTemperature
public void getClassificationScoresWithTemperature(Instance instance,
double temperature,
double[] scores)
classify
public Classification classify(Instance instance)
- Specified by:
classify
in class Classifier
print
public void print()
- Description copied from class:
Classifier
- Outputs human-readable description of classifier (e.g., list of weights, decision tree)
to System.out
- Overrides:
print
in class Classifier
print
public void print(java.io.PrintStream out)
printRank
public void printRank(java.io.PrintWriter out)
printExtremeFeatures
public void printExtremeFeatures(java.io.PrintWriter out,
int num)