The Naive Bayes Assumption
- The Naive Bayes classifier is a simple probabilistic classifier based on Bayes’ Theorem.
- It assumes that the features (attributes) are conditionally independent given the class label, hence the term “naive”.
- This assumption simplifies the computation, making it efficient for classification tasks.
The Naive Bayes Classifier
Training a Naive Bayes model involves calculating:
- Prior probability of each class .
- Conditional probabilities for each feature given class .
- For a given class , the posterior probability is:
- To classify a new instance, we compute the posterior probability for each class using Bayes’ Theorem and choose the class with the highest probability. Note : The denominator is the same for class posteriors!.
Advantages & Limitations of Naive Bayes
Naive Bayes classifier have several advantages :
- Simple and easy to implement.
- Works well with large datasets.
- Performs well with categorical and continuous features.
- Fast training and prediction.
It has some limitations:
- The “naive” assumption of feature independence is rarely true in practice.
- It may perform poorly with highly correlated features.
- Sensitive to imbalance datasets.