org.apache.spark.mllib.classification
Get the smoothing parameter.
Get the smoothing parameter.
Get the model type.
Get the model type.
Run the algorithm with the configured parameters on an input RDD of LabeledPoint entries.
Run the algorithm with the configured parameters on an input RDD of LabeledPoint entries.
Set the smoothing parameter.
Set the smoothing parameter. Default: 1.0.
Set the model type using a string (case-sensitive).
Set the model type using a string (case-sensitive). Supported options: "multinomial" (default) and "bernoulli".
Trains a Naive Bayes model given an RDD of
(label, features)
pairs.This is the Multinomial NB (see here) which can handle all kinds of discrete data. For example, by converting documents into TF-IDF vectors, it can be used for document classification. By making every vector a 0-1 vector, it can also be used as Bernoulli NB (see here). The input feature values must be nonnegative.