Manually solve the questions below by using the Nave Bayes Classifier: We conducted a survey to collect people's daily diets
Question:
Manually solve the questions below by using the Naïve Bayes Classifier:
We conducted a survey to collect people's daily diets and try to build a model to predict whether their diets result in healthy conditions or not. The final results could be Yes, or No. Note: using green rows as training, and orange rows as testing.
Breakfast | Lunch | Dinner | Healthy? |
Ham | Carnivorous | Beef | Y |
Milk | Carnivorous | Beef | N |
Bread | Veggie | Pork | N |
Bread | Veggie | Veggie | Y |
Ham | Veggie | Veggie | Y |
Milk | Carnivorous | Pork | N |
Bread | Carnivorous | Beef | N |
Ham | Veggie | Pork | Y |
Milk | Veggie | Pork | Y |
Milk | Carnivorous | Veggie | N |
Noddle | Carnivorous | Pork | ? |
1). [5 points] What is Laplace smoothing? And why do we need it in the Naïve Bayesian classifier?
2). [15 points] Using the Categorical Naive Bayesian Classification to make predictions on the test sets, present confusion matrix, and calculate accuracy, precision, recall, F1 measure, and specificity, by considering Y as a positive label
3). [20 points] Using the Categorical Naive Bayesian Classification to make predictions on the unseen data (note: building the model by using both the green and orange rows, and predicting the label for unseen data/last row)
Business Analytics Communicating With Numbers
ISBN: 9781260785005
1st Edition
Authors: Sanjiv Jaggia, Alison Kelly, Kevin Lertwachara, Leida Chen