Member-only story

Naive Bayes

Buse Köseoğlu
4 min readMar 3, 2021

Bayes Theorem

The probability value for an event A conditional to event B (i.e. event A is known, although event B is known) as an event studied in probability theory, the probability value for event B conditionally to event A (i.e. event A is known to event B) is different from the probability value. However, there is a very specific relationship between these two opposite conditionality, and this relationship is called Bayes’ Theorem, after the British statistician Thomas Bayes (1702–1761) who first explained it. (Wikipedia)

Naive Bayes Classifier

It is based on the bayes theorem. It can work successfully with unbalanced datasets or datasets with few inputs. While working, it calculates the possible values for an element and classifies it according to the highest value.

Naive Bayes cannot classify data that it has not seen before. In other words, if the value given in the test set is given in the training set and not taught to the model, the classification process will fail. This is called the “zero probability” problem. For example, the mail coming to a spam classifier is “lunch money money”. Since this model has never seen the word “lunch” in the training data set, it takes the probability of “lunch” to be spam as 0. No matter how likely the word “money” is to be spam, when using Naive Bayes this probability is…

--

--

No responses yet