Trains a Naive Bayes model given an RDD of (label, features)
pairs.
Trains a Naive Bayes model given an RDD of (label, features)
pairs.
This is the Multinomial NB (http://tinyurl.com/lsdw6p) 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 (http://tinyurl.com/p7c96j6).
RDD of (label, array of features)
pairs. Every vector should be a frequency
vector or a count vector.
The smoothing parameter
Trains a Naive Bayes model given an RDD of (label, features)
pairs.
Trains a Naive Bayes model given an RDD of (label, features)
pairs.
This is the Multinomial NB (http://tinyurl.com/lsdw6p) 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 (http://tinyurl.com/p7c96j6).
This version of the method uses a default smoothing parameter of 1.0.
RDD of (label, array of features)
pairs. Every vector should be a frequency
vector or a count vector.
Top-level methods for calling naive Bayes.