edu.stanford.nlp.classify
Class NaiveBayesClassifier
java.lang.Object
edu.stanford.nlp.classify.NaiveBayesClassifier
- All Implemented Interfaces:
- Classifier, RVFClassifier, Serializable
public class NaiveBayesClassifier
- extends Object
- implements Classifier, RVFClassifier
- Author:
- Kristina Toutanova (kristina@cs.stanford.edu)
A Naive Bayes classifier with a fixed number of features.
The features are assumed to have integer values even though RVFDatum will return doubles
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NaiveBayesClassifier
public NaiveBayesClassifier(Counter weights,
Counter priors,
Set labels,
Set features,
boolean addZero)
NaiveBayesClassifier
public NaiveBayesClassifier(Counter weights,
Counter priors,
Set labels)
labels
public Collection labels()
- Specified by:
labels
in interface Classifier
classOf
public Object classOf(RVFDatum example)
- Specified by:
classOf
in interface RVFClassifier
scoresOf
public Counter scoresOf(RVFDatum example)
- Specified by:
scoresOf
in interface RVFClassifier
classOf
public Object classOf(Datum example)
- Specified by:
classOf
in interface Classifier
scoresOf
public Counter scoresOf(Datum example)
- Specified by:
scoresOf
in interface Classifier
accuracy
public float accuracy(Iterator exampleIterator)
print
public void print(PrintStream pw)
print
public void print()
Stanford NLP Group