Project 2
Spring 2015
Due: Thu, Feb 12 Sun, Feb 15 @ 11:59 P.M.
10 points
Building upon your implementation for p1, implement k-NN and naive Bayes for nominal and numeric attributes. Also implement routines for k-fold cross-validation.
The implementations should be general in the sense that they should work for all data sets with nominal and numeric attributes and nominal class labels. Our convention is that the last attribute of the attribute declarations is the class label.
Tasks:
Implement the learners as two separate executables: NaiveBayes and IBk. No windows. No menus. No prompts. Just do it.
The logic of each implementation should be as follows. If the user runs a learner and specifies only a training set (using the -t switch), then the program should evaluate the method on the training set using 10-fold cross-validation and output the results. Naturally, the user can use the -x switch to change the default. Otherwise, if the user specifies both a training and testing set (using the -t and -T switches, respectively), then the program should use the hold-out method to build a model from the training set, evaluate it on the testing set, and output the results. The output should consist only of the accuracy or, in the case of k-fold cross validation, average accuracy and some measure of dispersion, such as variance, standard error, or a 95% confidence interval.
// // Name // E-mail Address // Platform: Windows, MacOS, Linux, Solaris, etc. // Language/Environment: gcc, g++, java, g77, ruby, python, etc. // // In accordance with the class policies and Georgetown's Honor Code, // I certify that, with the exceptions of the class resources and those // items noted below, I have neither given nor received any assistance // on this project. //
Submit via Blackboard. When you are ready to submit your program for grading, create a zip file of a single-level directory containing only your project's source, and upload it to Blackboard. The directory's name should be the same as your net ID. The zip file should be named p2.zip. If you need to include a note with your submission, put the note in a README file in the directory. Make sure I have clear instructions on how to build and run your executables. If you're using C or C++, provide a Makefile. If you're using Java, do not use packages. Make sure compiling your project produces two executables named NaiveBayes and IBk with the appropriate extension.