Laplace Smoothing
Also Additive Smoothing · Add-One Smoothing · Add-Epsilon Smoothing
Additive smoothing replaces the relative frequencies n_wc / n_c by (n_wc + α) / (n_c + α|V|) for some α > 0, so that every word gets a non-zero probability while the estimates stay a probability distribution.
Know these firstNaive Bayes Classifier
Formula#
Smoothing given probabilities (exam WS 19/20, Task 4.2). If only the learned are available, add to each of them and renormalize per class:
With this is additive smoothing with :
Properties#
The three properties asked in exam WS 19/20, Task 4.2, hold for every (resp. ):
- Non-zero: , and the denominator is positive, so for every word, also for unseen ones.
- Order preserved within a class: , and dividing by the same positive number keeps the strict inequality.
- Still a distribution: , so the of each class sum to .
Further:
- Why it is needed in Naive Bayes: a single word of that was never seen in class makes and the whole score of zero; in log space is undefined.
- Effect of : gives the unsmoothed relative frequencies; pushes every towards the uniform . Smoothing helps rare classes and short training sets most, where is small compared to .
Example#
Sources#
- Not covered by a WS 25/26 lecture. Source: the former Information Retrieval exams.
- Exam WS 19/20, Task 4.2 (not published) (
smooth(pwc, eps)with the three properties)