Naive bayes
The final model that we will cover here for classification is called Naive bayes. In Chapter 2, Matrices, Probability, and Statistics, we discussed the Bayes rule, which forms the basis of this technique. Naive Bayes is a probability-based method like logistic regression, but its basic ideas and assumptions are different.
Naive Bayes is also implemented in github.com/sjwhitworth/golearn
, which will allow us to easily try it out. However, there are a variety of other Go implementations including github.com/jbrukh/bayesian
, github.com/lytics/multibayes
, and github.com/cdipaolo/goml
.
Overview of naive bayes and its big assumption
Naive bayes operates under one large assumption. This assumption says that the probability of the classes and the presence or absence of a certain feature in our dataset is independent of the presence or absence of other features in our dataset. This allows us to write a very simple formula for the probability of a certain class, given the presence or absence...