Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Handin method and requirement: name your notebook file (.ipynb) as yourlastnamefirstname-studentID-hw3.ipynb.
For example, if your name is Amy Zhang, the file should be
named as zhang-amy-5678910-hw3.ipynb. Also, attach an html file (generated by the
notebook file) with your notebook using the naming rule: yourlastname-firstnamestudentID-hw2.html.
(-10 points if missing these files)
You are allowed to form a group of size <=2 for this homework. In that case, you two will get
the same grade for this homework. If you choose to do this by yourself, +10 points (that
means, you could get 90)
Homework overview: Implement the Na?ve Bayes Classifier (NBC) for the given training
data, apply it to the given testing data, and report the accuracy on both the training and testing
data.
You need to use two methods to learn the conditional probabilities for continuous attributes.
One is based on a parametric distribution such as normal distribution. The other is
discretization (you need to figure out how to do this and describe it in the report).
You need to implement NBC yourself. Calling any API or existing functions of NBC will
lead to 0 for this homework.
Data:
Canvasàfiles/homework/hw3 à training sample.csv, testing sample.csv
The data format and meanings are self-explanatory.
Requirement and grading:
1. (20 pts) Submit two programs with the two different methods of computing
conditional probabilities for continuous attributes. Each python program must take
two files as inputs. One is the training data and the other is the testing data. In
practice, you can separate the training and testing. But in this homework, we will look
at them altogether. Don’t hardcode the input files because we can change the contents
of the test data (while keeping the same format).