Naive Bayes Practice Set
Naive Bayes Practice Set
Instructions
For each problem below, compute the required posterior probabilities using appropriate Naive
Bayes assumptions (Bernoulli, Multinomial, or Gaussian as indicated). Assume features are
conditionally independent given the class.
1
Email offer free win Class
1 2 1 0 Spam
2 0 0 1 Not Spam
3 3 2 1 Spam
4 0 1 2 Not Spam
5 1 0 1 Spam
6 0 1 0 Not Spam
7 2 1 3 Spam
8 1 2 0 Not Spam
2
Problem 5: Customer Churn (Mixed Features)
Task: Predict churn for a new customer with Plan=Silver and Usage=3.5 using mixed
(categorical + Gaussian) Naive Bayes.
3
Sentence bonjour hello gracias merci thanks Language
1 2 0 0 1 0 French
2 0 1 0 0 2 English
3 0 0 3 0 0 Spanish
4 1 0 0 2 0 French
5 0 2 0 0 1 English
6 0 0 2 0 0 Spanish
7 1 0 0 1 0 French
8 0 1 0 0 1 English
9 0 0 1 0 0 Spanish
4
Case Flu Cough Fever Sick
1 Yes Yes Yes Yes
2 No No No No
3 Yes Yes Yes Yes
4 No Yes Yes Yes
5 Yes Yes No Yes
6 No No No No
7 Yes No Yes Yes
8 No Yes No No