Skip to main content

Module naive_bayes

Module naive_bayes 

Source
Expand description

Naive Bayes classifiers.

See the book entry Naive Bayes.

Structs§

GaussianNaiveBayes
Gaussian naive Bayes: each class models every feature as an independent normal distribution (the “naive” independence assumption), and a point goes to the class with the highest posterior P(class) Π P(x_j | class). Fast, needs little data, and surprisingly strong when features are roughly independent given the class. var_smoothing adds a fraction of the largest feature variance to every variance, which keeps constant features from causing division by zero.
MultinomialNaiveBayes
Multinomial naive Bayes for count features (word counts, histograms): the class-conditional feature distribution is multinomial with Laplace/Lidstone smoothing alpha.