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.
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 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.
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.
ADVANTAGES OF NAIVE BAYES
- It is simple and easy to implement.
- Handles both continuous and discrete data.
- It is highly scalable with the number of predictors and data points.
DISADVANTAGES OF NAIVE BAYES
- Naive Bayes implicitly assumes that all the attributes are mutually independent. In most of the real-life cases, the predictors are dependent, this hinders the performance of the classifier.
APPLICATIONS OF NAIVE BAYES
- Sentiment Analysis
- Weather Prediction
- Face Recognition
- Medical Diagnosis
- News Classification