The task of training such a classifier involves estimating the parameters in θ, given a set of labeled To do this, we use a Dirichlet prior and take the expectation of each parameter with respect to the posterior, which is a simple way to estimate a multinomial (Heckerman, 1995).
we count the fraction of times the word f k occurs in the labeled set among documents of class y j , and the prior adds m jk "hallucinated" occurrences for a smoothed version of the maximum likelihood estimate: Here, m jk is the prior for word f k under class y j , P (y j |x (i) ) ∈ {0, 1} indicates the true labeling of the ith document in the training set, and Z(f k ) is a normalization constant summing over all words in the vocabulary.