Learn Before
Concept

Avoiding Zero Probabilities in Naive Bayes

While training a Naive Bayes classifier, zero probabilities in the likelihood term for any class will cause the overall posterior probability of that class to be zero, regardless of other evidence. A common solution is Laplace (add-one) smoothing, which is defined as:

P(wic)=count(wi,c)+1wV(count(w,c)+1)=count(wi,c)+1wVcount(w,c)+VP(w_i|c) = \frac{count(w_i,c)+1}{\sum_{w\in V}{(count(w,c)+1)}} = \frac{count(w_i,c)+1}{\sum_{w\in V}{count(w,c)}+|V|}

0

1

Updated 2026-06-17

Tags

Data Science