Package 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
-
-
Field Summary
-
Fields inherited from class cc.mallet.classify.MaxEnt
defaultFeatureIndex, featureSelection, parameters, perClassFeatureSelection
-
Fields inherited from class cc.mallet.classify.Classifier
instancePipe
-
-
Constructor Summary
Constructors Constructor Description RankMaxEnt(Pipe dataPipe, double[] parameters)
RankMaxEnt(Pipe dataPipe, double[] parameters, FeatureSelection featureSelection)
RankMaxEnt(Pipe dataPipe, double[] parameters, FeatureSelection[] perClassFeatureSelection)
RankMaxEnt(Pipe dataPipe, double[] parameters, FeatureSelection featureSelection, FeatureSelection[] perClassFeatureSelection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Classification
classify(Instance instance)
void
getClassificationScores(Instance instance, double[] scores)
void
getClassificationScoresForTies(Instance instance, double[] scores, int[] bestLabels)
Used by RankMaxEntTrainer to calculate the value when the labeling contains ties.void
getUnnormalizedClassificationScores(Instance instance, double[] scores)
returns unnormalized scores, corresponding to the score an element of the InstanceList being the "top" instancevoid
print()
Outputs human-readable description of classifier (e.g., list of weights, decision tree) to System.out-
Methods inherited from class cc.mallet.classify.MaxEnt
getClassificationScoresWithTemperature, getDefaultFeatureIndex, getFeatureSelection, getNumParameters, getNumParameters, getParameters, getPerClassFeatureSelection, print, 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
-
-
-
-
Constructor Detail
-
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)
-
-
Method Detail
-
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 classMaxEnt
- Parameters:
instance
- instance with data field aInstanceList
.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 classMaxEnt
-
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)
-
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
-
-