Project 7: Naive Bayes Analysis
Project due Monday night Apr 14, 2014
The purpose of this assignment is to use your Naive Bayes implementation to classify data. You will evaluate the effectiveness of the classifier and plot the results.
- Write analysis.computeConfusionMatrix
# compute the confusion matrix given the two columns of actual and # predicted class values. # Each of the inputs is an N x 1 matrix, and its values are 0, 1, ..., C-1 # where C is the number of classes def computeConfusionMatrix( actual_class_vals, predicted_class_vals )
- Test the confusion matrix code by running naive_bayes_test3.py. The output Stephanie gets for her code is here.
- Write specialized scripts to test the naive bayes classifier on 2 more sets of data. Each data must have a class feature (e.g. the name of the iris species), so you may not be able to use one from a previous project. (Note that it was an extension in project 2 to turn enumerated types into numeric types. If you have not completed that extension, then you will need to make sure that the class values are integers between 0 and C-1 where C is the number of classes.)
- Write out your data and classification results to a file, then visualize it using your display.py program.
- Update your GUI to allow Naive bayes classification (model it after the way you added clustering). It would be great to visualize the confusion matrix, too.
- Write functions to compute the TP, NP, etc. values for each class. (input will be the Nx1 matrices of actual values and the predicted values. output will be the TP etc. for each class)
- Make your Naive Bayes method more sophisticated. For example, you could use the alternate computations for the prior and the likelihood as outlined in teh notes.
- Implement cross-validation.
- Figure out how to get it all working with enum classes instead of just with numbers. If you can get the labels for the confusion matrix printing to have those enum values instead of just numbers, it would be very helpful.
For this week's writeup, create a wiki page that shows your Naive Bayes results (images are helpful!), analyzes the results of your classifying from task 3, and explains any extensions.
Once you have written up your assignment, give the page the label:
Put your code in a folder named Proj7 on the Courses/CS251 server in your private subdirectory.