According to Laplace Smoothing: We add 1 to numerator and |v| to denominator.
In this video example, |v| = 5 but still we add 2 to the denominator. I know it is bernoulli distribution. But don’t we add size of vocab in the denominator?
Why do we add 2 in denominator in case of Bernaulli NB
Hey @harshsharmajnv_9b70d236614796d5
In multivariate bernoulli naive bayes we consider 1/0 for each word which means we take 1 if word is present and 0 if word is not present. So for every word has two choices only, and while applying laplace smoothing we add 1 to the numerator, and 2 to the denominator.
Its the way of smoothing, we added 1 to the numerator, that means some how we introduced an extra example having that word, but this should not be the idle case, The idle case should be we introduce two examples, one of them having the word and one not having it. So 2 is added to the denominator and 1 to the numerator.
Hope this might helps
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.