The Naive Bayes That Beats Its Own Assumptions
Suppose you want to classify emails as spam or not-spam. You train a Naive Bayes classifier, which assumes all features (words) are conditionally independent given the class. You know for a fact that many words are highly correlated โ "free" and "prize" almost always appear together.
Despite this blatant violation of the independence assumption, your colleague claims:
"Even though Naive Bayes gives wildly wrong probability estimates, its decision boundary (i.e., which class it predicts) can still be optimal."
Is your colleague correct? Give a concrete argument for why this can happen, and explain what structural property of the decision rule makes it robust to miscalibration of probabilities.
Answer: Naive Bayes Beats Its Own Assumptions
Key Idea / Intuition
Naive Bayes makes a decision by comparing vs , which is equivalent to asking whether the log-odds ratio crosses zero. Even if each individual probability is wildly wrong due to the false independence assumption, the log-odds ratio only needs to have the correct sign to make the correct classification. The threshold is zero, not the actual probability value โ so calibration errors can cancel out or simply not affect the sign of the decision.
Formal Proof / Solution
Setup. Let and features . Naive Bayes predicts class 1 if:
Under the independence assumption, this becomes:
where .
The wrong model, the right boundary. Even if the true joint is
the predicted probabilities are miscalibrated. However, the decision boundary is:
This coincides with the Bayes-optimal decision if and only if:
A concrete example. Suppose with features that are perfectly correlated: always. The true log-odds is:
Naive Bayes computes instead:
This double-counts the evidence, but if the per-feature log-odds is positive (resp. negative), doubling it preserves the sign. So the decision is still correct โ only the magnitude of the score is wrong, not its direction.
The structural reason. The Naive Bayes log-odds is a monotone function of the true log-odds in many symmetric situations. More generally, if the Naive Bayes score is a strictly increasing transformation of the true posterior log-odds (even a nonlinear one), then the zero-crossing (decision boundary) is preserved.
Formal statement (Domingos & Pazzani, 1997). Naive Bayes can be optimal even when the independence assumption is severely violated, because optimality of classification only requires the ranking of posteriors to be correct for most inputs, not the actual probability values.
Takeaway. There is a strict separation between:
- Calibration (do the predicted probabilities match true probabilities?) โ Naive Bayes often fails here.
- Decision accuracy (does the argmax give the right class?) โ Naive Bayes can succeed here even under gross model misspecification.
This is why Naive Bayes is surprisingly competitive in practice despite its obviously wrong assumptions.
Source: Domingos & Pazzani (1997), 'On the Optimality of the Simple Bayesian Classifier under Zero-One Loss'; ESL Ch. 6