public final class MultinomialNaiveBayes extends AbstractClassifier
| Constructor and Description |
|---|
MultinomialNaiveBayes()
Default constructor to construct this classifier.
|
MultinomialNaiveBayes(boolean verbose)
Pass true if this classifier should output some progress information to
STDOUT.
|
| Modifier and Type | Method and Description |
|---|---|
static MultinomialNaiveBayes |
deserialize(DataInput in)
Deserializes a new MultinomialNaiveBayesClassifier from the given input
stream.
|
de.jungblut.math.DoubleVector |
predict(de.jungblut.math.DoubleVector features)
Classifies the given features.
|
static void |
serialize(MultinomialNaiveBayes model,
DataOutput out) |
void |
train(Iterable<de.jungblut.math.DoubleVector> features,
Iterable<de.jungblut.math.DoubleVector> outcome)
Trains this classifier with the given features and the outcome.
|
trainextractPredictedClass, extractPredictedClass, predictedClass, predictedClass, predictProbabilityclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasClassifier, extractPredictedClass, extractPredictedClass, predictedClass, predictedClass, predictProbabilitypublic MultinomialNaiveBayes()
public MultinomialNaiveBayes(boolean verbose)
public void train(Iterable<de.jungblut.math.DoubleVector> features, Iterable<de.jungblut.math.DoubleVector> outcome)
Classifiertrain in interface Classifiertrain in class AbstractClassifieroutcome - the outcome must have classes labeled as doubles. E.G. in
the binary case you have a single element and decide between 0d
and 1d. In higher dimensional cases you have each of these single
elements mapped to a dimension.public de.jungblut.math.DoubleVector predict(de.jungblut.math.DoubleVector features)
Predictorpublic static MultinomialNaiveBayes deserialize(DataInput in) throws IOException
IOExceptionpublic static void serialize(MultinomialNaiveBayes model, DataOutput out) throws IOException
IOExceptionCopyright © 2016. All rights reserved.