Naive Bayes classifiers are a collection of classification algorithms based on Bayes’ Theorem
. It is not a single algorithm but a family of algorithms where all of them share a common principle, i.e. every pair of
features being classified is independent of each other.
The classifier is based on Bayes Theorem. Bayes’ Theorem finds the probability of an event occurring given the
probability of another event that has already occurred. Bayes’ theorem is stated mathematically as the following equation:
Here, the dataset is divided into two parts, namely, feature matrix and the response vector .
Feature matrix contains all the vectors(rows) of dataset in which each vector consists of the value of dependent features.
Response vector contains the value of class variable(prediction or output) for each row of feature matrix.
The fundamental Naive Bayes assumption is that each feature makes an: 1. independent
2. equal contribution to the outcome.
we can apply Bayes’ theorem in following way:
where, y is class variable and X is a dependent feature vector (of size n) where: