1

If I want to use naive bayes with laplace smoothing and therefore add 1 to probabilities with the value of 0, what does this mean for probabilities which have the actual value of 1?

usεr11852
  • 33,608
  • 2
  • 75
  • 117
link
  • 19
  • 1
  • 2

1 Answers1

2

A value 1 is added to each feature count (not just to the feature having a count/frequency of 0 ). To be more specific, consider the case of text classification. Let us suppose that $Y_k, k=1,2,\cdots K$ denote the labels of the $K$ classes, $X_j$ denote the $j^{th}$ word and $V$ denote the total number of distinct words(vocabulary size) in all of the $n=\sum_{k=1}^{K}n_{k}$ documents, where $n_{k}$ denote the number of documents labelled as $Y_{k}$. Then, the Laplace estimate of the probability for the word $X_{j}$ in the class $Y_{k}$ is given by $$P(X_{j}|Y_{k})\dfrac{Count(X_{j},Y_{k})+1}{\sum_{j}^{V}(Count(X_{j},Y_{k})+1)}.$$

L.V.Rao
  • 1,909
  • 15
  • 23