cc.mallet.classify
Class RankMaxEnt
java.lang.Object
cc.mallet.classify.Classifier
cc.mallet.classify.MaxEnt
cc.mallet.classify.RankMaxEnt
- All Implemented Interfaces:
- AlphabetCarrying, java.io.Serializable
public class RankMaxEnt
- extends MaxEnt
Rank Maximum Entropy classifier. This classifier chooses among a set of
Instances with binary labels. Expects Instance data to be a
FeatureVectorSequence, and the target to be a String representation of the
index of the true best FeatureVectorSequence. Note that the Instance target
may be a Labels to indicate a tie for the best Instance.
- Author:
- Aron Culotta culotta@cs.umass.edu
- See Also:
- Serialized Form
Methods inherited from class cc.mallet.classify.MaxEnt |
getClassificationScoresWithTemperature, getDefaultFeatureIndex, getFeatureSelection, getNumParameters, getNumParameters, getParameters, getPerClassFeatureSelection, print, printExtremeFeatures, printRank, setDefaultFeatureIndex, setFeatureSelection, setParameter, setParameters, setPerClassFeatureSelection |
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 |
RankMaxEnt
public RankMaxEnt(Pipe dataPipe,
double[] parameters,
FeatureSelection featureSelection,
FeatureSelection[] perClassFeatureSelection)
RankMaxEnt
public RankMaxEnt(Pipe dataPipe,
double[] parameters,
FeatureSelection featureSelection)
RankMaxEnt
public RankMaxEnt(Pipe dataPipe,
double[] parameters,
FeatureSelection[] perClassFeatureSelection)
RankMaxEnt
public RankMaxEnt(Pipe dataPipe,
double[] parameters)
getUnnormalizedClassificationScores
public void getUnnormalizedClassificationScores(Instance instance,
double[] scores)
- returns unnormalized scores, corresponding to the score an
element of the InstanceList being the "top" instance
- Overrides:
getUnnormalizedClassificationScores
in class MaxEnt
- Parameters:
instance
- instance with data field a InstanceList
.scores
- has length = number of Instances in Instance.data,
which is of type InstanceList
getClassificationScores
public void getClassificationScores(Instance instance,
double[] scores)
- Overrides:
getClassificationScores
in class MaxEnt
getClassificationScoresForTies
public void getClassificationScoresForTies(Instance instance,
double[] scores,
int[] bestLabels)
- Used by RankMaxEntTrainer to calculate the value when the labeling contains ties. Does not include scores of tied elements in normalization.
- Parameters:
instance
- scores
- bestLabels
- Indices of Instances ties for 1st place.
classify
public Classification classify(Instance instance)
- Overrides:
classify
in class MaxEnt
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 MaxEnt