 Naive Bayes Algorithm

The Naive Bayes is a supervised machine learning algorithm for classification. It is fast to build models and make predictions with Naive Bayes algorithm. Text classification is one of the most popular applications of a Naive Bayes classifier.

The Naive Bayes algorithm is called naive because the occurrence of a certain feature is independent of the occurrence of other features. All the features individually contribute to the probability.

For example, a fruit may be considered as an Orange if its color is orange, shape is round, and about 10 cm in diameter. A naive Bayes classifier considers each of these features to contribute independently to the probability that this fruit is an apple, regardless of correlation between the features, i.e., color, roundness, and diameter.

Bayes Theorem

Naive Bayes classifier is a collection of classification algorithms based on Bayes theorem. It is a theorem which works on conditional probability. Hence, naive bayes is a probabilistic classifier.

Conditional probability

Conditional probability is the probability that something will happen, given that something else has already occurred. The conditional probability can give us the probability of an event using its prior knowledge. Where,

P(H) – The probability of hypothesis H is true.

P(E) – The probability of the evidence E.

P(E|H) – The probability of the evidence given that hypothesis is true.

P(H|E) – The probability of the hypothesis given that the evidence is true.