/Pattern-Recognition

Project work for Pattern Recognition project

Primary LanguageMATLAB

Pattern-Recognition

Project work for Pattern Recognition Module Divided into 2 parts The first part is for SPAM email classification, contains Beta-binomial Naive Bayes Classifier, Gaussian Naive Classifier, Logistic Regression Classifier and K-Near Neighbor classifier.

Instrution to run the .m files

1.Please copy these files to your Matlab path NOTE: The file spamData.mat contains the training and testing data of the Classifier The file BNB refers to the Beta-binomial Naive Bayes Classifier The file GNB refers to the Gaussian Naive Bayes Classifier The file LR refers to the Logistic Regression Classifier The file KNN refers to the K-Nearest Neighbors Classifier

2.Run the .m files with your Matlab NOTE: The file BNB will output a figure plot the error rate for the training set and the testing set versus the parameter alpha, the error rate for alpha=1,10,100 are saved in the TestR and TrainR The file GNB will output the errorRateTest and the errorRateTrain into the command window The file LR will out put a figure plot the error rate for the training set and the testing set versus the parameter lambda, the error rate for lambda=1,10,100 are saved in the TestR and TrainR The file KNN will run for a long time, roughly 10 minutes. The file KNN will out put a figure plot the error rate for the training set and the testing set versus the parameter K, the error rate for K=1,10,100 are saved in the TestR and TrainR