class documentation
class ClassifierI(object): (source)
Known subclasses: nltk.classify.decisiontree.DecisionTreeClassifier
, nltk.classify.maxent.MaxentClassifier
, nltk.classify.naivebayes.NaiveBayesClassifier
, nltk.classify.scikitlearn.SklearnClassifier
, nltk.classify.weka.WekaClassifier
A processing interface for labeling tokens with a single category label (or "class"). Labels are typically strs or ints, but can be any immutable type. The set of labels that the classifier chooses from must be fixed and finite.
- Subclasses must define:
- labels()
- either classify() or classify_many() (or both)
- Subclasses may define:
- either prob_classify() or prob_classify_many() (or both)
Method | classify |
No summary |
Method | classify |
Apply self.classify() to each element of featuresets. I.e.: |
Method | labels |
No summary |
Method | prob |
No summary |
Method | prob |
Apply self.prob_classify() to each element of featuresets. I.e.: |
overridden in
nltk.classify.decisiontree.DecisionTreeClassifier
, nltk.classify.maxent.MaxentClassifier
, nltk.classify.naivebayes.NaiveBayesClassifier
Returns | |
label | the most appropriate label for the given featureset. |
Apply self.classify() to each element of featuresets. I.e.:
return [self.classify(fs) for fs in featuresets]
Returns | |
list(label) | Undocumented |
overridden in
nltk.classify.decisiontree.DecisionTreeClassifier
, nltk.classify.maxent.MaxentClassifier
, nltk.classify.naivebayes.NaiveBayesClassifier
, nltk.classify.scikitlearn.SklearnClassifier
Returns | |
list of (immutable) | the list of category labels used by this classifier. |