AY21/22 Semester1. NUS Pattern Recognition course(EE5907): project1 for SPAM, project2 for face recognition.
Each Matlab files includes one Machine Learning method, consisting of Beta-binomial Naive Bayes, Gaussian Naive Bayes, Logistic regression, K-Nearest Neighbors. The detail of each requirement is shown in EE5907_EE5027_SPAM.pdf.The raw data of spam is in spamData.mat.
This is EE5907 Programming Assignment.
- Assignment1 to Assignment4 indicates Beta-binomial Naive Bayes,Gaussian Naive Bayes, Logistic regression and K-Nearest Neighbors respectively.
- Before running any code, spamData.mat should be placed in the same folder with them.
- The results of Assignment1,3,4 also includes a picture of training and testing error rate, which are also included in this folder,named by their assignment.
- Assignment4 may take about 1min to run, thank you for your time and patience.
23.Sept.2021
In Gaussian Naive Bayes question, ML estimation of mean and variance of training set are calculated for testing set and training to fit in.From the Matlab code, it can be calculated that training error rate and testing error rate are 0.1657 and 0.1602 respectively.
Includes PCA,LDA,SVM,GMM,CNN algorithm.
This is the second assignment of EE5907.
- For each part, they are seperated in folders with name of the content.And PIE is the original face image and my selfie.
- The information of images is saved as .mat file and can be loaded automatically in each part. The original selfie are saved in 'PIE/selfie'. PCA,LDA and SVM part are completed in Matlab, which can be run directly. Since LIBSVM is not suitable for Mac system with M1 core, Matlab function fitcsvm is applied for SVM part.
- GMM and CNN are completed by python, which should be imported with required library before running. GMM is based on sklearn,while CNN is based on tensorflow.
- Each code need about 20s to run, CNN require few minutes to train its model. Then results will be shown. They are also saved as .fig or .png files in each folder respectively, which are convienent to see without running the code.
C parameter | raw image | PCA 80 | PCA 200 |
---|---|---|---|
C=0.01 | 98.44% | 92.88% | 96.09% |
C=0.1 | 98.75% | 95.38% | 97.18% |
C=1 | 98.83% | 96.40% | 97.89% |