The Naive Bayes Independence Assumption: When Does It Hurt?
Suppose you are classifying emails as spam or not spam using Naive Bayes, which assumes that all features are conditionally independent given the class label .
Now consider just two binary features: = "contains the word 'free'" and = "contains the word 'prize'". In spam emails, these two words are highly positively correlated: if one appears, the other almost certainly does too.
The puzzle: Despite this blatant violation of the independence assumption, Naive Bayes classifiers often still produce the correct classification decision (even if the probability estimates are badly wrong).
Explain precisely and concisely:
- Why does the independence violation corrupt the probability estimates?
- Why does the classifier often still get the decision right?
As a concrete sanity check: suppose
but Naive Bayes computes (incorrectly assuming independence):
Both the true and naive likelihood ratios favor enormously. What does this tell you about Naive Bayes?
Answer: Naive Bayes Independence Violation: Wrong Probabilities, Right Decisions
Key Idea / Intuition
Naive Bayes corrupts the magnitude of the posterior probabilities because it double-counts correlated evidence โ seeing "free" and "prize" together gets counted as two independent pieces of evidence when they really carry only one. But the decision boundary only cares about which side of the posterior ratio equals 1 โ i.e., whether the log-odds is positive or negative. As long as the corruption pushes in the same direction for both classes, the sign of the log-odds is preserved, and the classification is correct.
Formal Proof / Solution
Part 1: Why Probability Estimates Are Wrong
The Naive Bayes posterior is
When and are positively correlated given , the true joint satisfies
So the Naive Bayes model underestimates the true joint likelihood for spam. Similarly it underestimates for . The two underestimates do not cancel, so the resulting posterior is not calibrated โ it can be systematically too extreme or too conservative.
Part 2: Why the Decision Is Often Still Correct
The Naive Bayes classifier predicts if and only if the log-odds is positive:
Each term is individually a valid signal pointing in the right direction. The problem is that correlated features add redundant signals โ but redundant signals that all point the same way only make the log-odds more extreme, not wrong in sign.
Concrete Example
Using the numbers in the problem, the true likelihood ratio is
The Naive Bayes likelihood ratio is
Both are much greater than 1. The naive version wildly over-inflates the ratio (because it double-counts), but the sign โ and hence the decision โ is still correct: classify as spam.
Summary Table
| Quantity | True model | Naive Bayes | |---|---|---| | Likelihood ratio | 16 | 256 | | Decision (?) | โ | โ | | Probability estimate | Correct | Overconfident |
The Punchline
Naive Bayes is a bad density estimator but can be a good classifier. The independence assumption inflates or deflates posterior probabilities, but as long as it inflates the correct class's score more than the wrong class's, the decision boundary is unchanged. This is why Naive Bayes famously works well in practice (e.g., spam filters) even when its independence assumption is obviously false โ it is solving a simpler problem (sign of log-odds) than full probability calibration.
This insight is sometimes called the "optimism of Naive Bayes": the model is overconfident but directionally correct.
Source: The Elements of Statistical Learning, Hastie, Tibshirani, Friedman (2nd ed.), Chapter 6 / general ML folklore