Package cc.mallet.classify
Class MostFrequentClassifier
- java.lang.Object
-
- cc.mallet.classify.Classifier
-
- cc.mallet.classify.MostFrequentClassifier
-
- All Implemented Interfaces:
AlphabetCarrying
,java.io.Serializable
public class MostFrequentClassifier extends Classifier
A Classifier that will return the most frequent class label based on a training set. The Classifier needs to be trained using the MostFrequentClassAssignmentTrainer.- Author:
- Martin Wunderlich martin@wunderlich.com
- See Also:
MostFrequentClassAssignmentTrainer
, Serialized Form
-
-
Field Summary
-
Fields inherited from class cc.mallet.classify.Classifier
instancePipe
-
-
Constructor Summary
Constructors Constructor Description MostFrequentClassifier(Pipe instancePipe)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTargetLabel(Label label)
Classification
classify(Instance instance)
Classify an instance using the most frequent class label.-
Methods inherited from class cc.mallet.classify.Classifier
alphabetsMatch, classify, classify, classify, getAccuracy, getAlphabet, getAlphabets, getAverageRank, getF1, getF1, getF1, getFeatureSelection, getInstancePipe, getLabelAlphabet, getPerClassFeatureSelection, getPrecision, getPrecision, getPrecision, getRecall, getRecall, getRecall, print, print
-
-
-
-
Constructor Detail
-
MostFrequentClassifier
public MostFrequentClassifier(Pipe instancePipe)
-
-
Method Detail
-
classify
public Classification classify(Instance instance)
Classify an instance using the most frequent class label.- Specified by:
classify
in classClassifier
- Parameters:
Instance
- to be classified. Data field must be a FeatureVector.- Returns:
- Classification containing the labeling of the instance.
-
addTargetLabel
public void addTargetLabel(Label label)
-
-