Learn Before
Concept

Training the Naive Bayes Classifier

To train a Naive Bayes classifier using maximum likelihood estimation, we first concatenate all documents belonging to category cc into a single text representation. Then, we use the word frequencies in this concatenated document to compute the maximum likelihood estimate of the probability of each word wiw_i given the class cc:

P(wic)=count(wi,c)wVcount(w,c)P(w_i|c) = \frac{count(w_i,c)}{\sum_{w\in V}count(w,c)}

where VV represents the vocabulary containing all unique words in the training dataset.

0

1

Updated 2026-06-18

Tags

Data Science

Learn After