public class NaiveBayesClassifier<L,F> extends java.lang.Object implements Classifier<L,F>, RVFClassifier<L,F>
Pair<Pair<L, F>, Object>
but this seems like a strange thing to expect to be passed in.Constructor and Description |
---|
NaiveBayesClassifier(Counter<Pair<Pair<L,F>,java.lang.Number>> weights,
Counter<L> priors,
java.util.Set<L> labels) |
NaiveBayesClassifier(Counter<Pair<Pair<L,F>,java.lang.Number>> weights,
Counter<L> priors,
java.util.Set<L> labels,
java.util.Set<F> features,
boolean addZero) |
Modifier and Type | Method and Description |
---|---|
float |
accuracy(java.util.Iterator<RVFDatum<L,F>> exampleIterator) |
L |
classOf(Datum<L,F> example) |
L |
classOf(RVFDatum<L,F> example) |
java.util.Collection<L> |
labels() |
void |
print() |
void |
print(java.io.PrintStream pw) |
ClassicCounter<L> |
scoresOf(Datum<L,F> example) |
ClassicCounter<L> |
scoresOf(RVFDatum<L,F> example) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
evaluateAccuracy, evaluatePrecisionAndRecall
public NaiveBayesClassifier(Counter<Pair<Pair<L,F>,java.lang.Number>> weights, Counter<L> priors, java.util.Set<L> labels, java.util.Set<F> features, boolean addZero)
public java.util.Collection<L> labels()
labels
in interface Classifier<L,F>
public L classOf(RVFDatum<L,F> example)
classOf
in interface RVFClassifier<L,F>
public ClassicCounter<L> scoresOf(RVFDatum<L,F> example)
scoresOf
in interface RVFClassifier<L,F>
public ClassicCounter<L> scoresOf(Datum<L,F> example)
scoresOf
in interface Classifier<L,F>
public void print(java.io.PrintStream pw)
public void print()