Multinomial Parameter Estimation using MLE and MAP (Dirichlet Prior) on Text Data
Experiment
Title
Multinomial Parameter Estimation using MLE and MAP (Dirichlet Prior) on Text Data
🎯 Objective
-
To estimate word probabilities using:
- MLE (Maximum Likelihood Estimation)
- MAP (Dirichlet prior)
- To analyze how priors affect probability estimates
- To understand smoothing in text models (Naive Bayes context)
📚 Background Theory
🔹 Multinomial Distribution
Used for discrete counts (e.g., word frequencies in documents).
🔹 MLE Estimate
-
: count of word
- No smoothing → zero probabilities possible
🔹 MAP Estimate (Dirichlet Prior)
- : prior parameters
- Acts as smoothing
🧩 Dataset
Use 20 Newsgroups dataset:
- Text classification dataset
- Each document → bag-of-words
💻 Combined Simple Program
🔍 Observations
🔹 MLE
- Assigns zero probability to unseen words
- Highly skewed distribution
- Dominated by frequent words
🔹 MAP (Dirichlet Prior)
| Prior (α) | Effect |
|---|---|
| α = 1 | Same as MLE (no smoothing) |
| α = 2 | Slight smoothing |
| α = 10 | Strong smoothing |
🔹 Key Insights
- MAP prevents zero probabilities
- Higher α → more uniform distribution
- Acts like Laplace smoothing
📊 Comparison Table
| Aspect | MLE | MAP (Dirichlet) |
|---|---|---|
| Zero probabilities | Yes | No |
| Robustness | Low | High |
| Prior knowledge | Not used | Used |
| Smoothing | None | Yes |
Result
- MLE is sensitive to sparse data
- MAP (Dirichlet) provides stable probability estimates
-
Essential in:
- Text classification
- Naive Bayes
- Larger priors → smoother distributions
Comments
Post a Comment