What is Laplace estimator?
If we consider the spam classification model, it may happen that some words never appear in the past while model building but may appear in a later stage which can make the entire calculation as zero.
To avoid such situations, a Laplace estimator is used. It essentially adds a small number to each of the counts in the frequency table, which in return ensures that the probability of occurring with each class in each feature is non zero. Usually Laplace estimator is set to 1, which ensures that each class-feature combination is found in the data at least once.
It works on the following formula.
In the above equation, 1 is added to all the words in the numerator and 3 is also added in all the denominators to maintain equivalence.