Question: 1. Consider the training data set below. Your goal is to build a classifier to predict the last column Beach using the input attributes:
1. Consider the training data set below. Your goal is to build a classifier to predict the last column "Beach" using the input attributes: "Thunder", "Hailstorm", "Homework" and "Tsunami". More specifically, you will compare Naive Bayes (NB) and Decision Tree (DT). For Naive Bayes (NB), you will use m-estimate from the lecture with m = 0.001 and p = 0.5 for probability estimations. For example, based on the training dataset below, the original probability estimation for P(Beach = Yes) = 9/11 while its corresponding m-estimate is: P(Beach = Yes) = (9+m*p)/(14+m) = (9+0.001*0.5)/(14+0.001). For Decision Tree (DT), you will follow the lecture to build your trees, where multiple-way splitting is allowed and Information Gain (IG) is employed to select the best attribute. In the case of ties, break ties in favor of the leftmost feature. Homework Tsunami Day Thunder Hailstorm. Beach E Overcast Cool High Wonk Yes 2 Sunny Hot High Strong No 3 Sunny Hot High Strong Yes 4 Overcast Cool High Weak Ye 5 Sunny Hot Normal Strong No G Sunny Cool High Strong 7 Overcast Cool Normal Weak Yes 8 Sunny Hot Normal Strong No 9 Overcast Hot Normal Weak Yes 10 Overcast Hot High Strong Yes 11 Overcast Cool Normal Strong No 12 Sunny Hot High Weak No 13 Overcast Hot High Strong Yes 14 Sunny Cool High Weak No (i) (10 points) Compare the performance of NB vs. DT using 2-fold cross-validation (CV) and report their 2-fold CV accuracy. For the ith fold, the testing dataset is composed of all the data points whose (Day mod 2 = 1-1). For each fold, show the induced Naive Bayes and DT models. (5 points) Based on the 2-fold CV accuracy from (a), which classifier, NB or DT, would you choose? Report your final model for the selected classifier.
Step by Step Solution
3.46 Rating (166 Votes )
There are 3 Steps involved in it
package testjavafx import javafxapplication Application import javafxevent ActionEvent import javafxevent EventHandler import javafxsceneScene import javafxscenecontrolButton import javafxscenelayoutStackPane import javafx ... View full answer
Get step-by-step solutions from verified subject matter experts
