CBMM Summer School, Day 2: Machine Learning

 Lab: Real Data - Handwritten Digit Challenge

Extract the zip file in a directory and set the MATLAB path to that with subdirs (for the data). Follow the instructions below and think/try hard before you call the instructors!


1. Warm Up - (MNIST Data)

ind = find((sign(Ypred)~=sign(Yts)));
idx = ind(randi(numel(ind)));
figure; visualizeExample(Xts(idx,:));

2. Challenge Data

The problem that you are given is the classification of images of handwritten digits and specifically the binary classification problem of  discriminating '4' and '2'. The file Challenge_Train.mat contains the training set (Xtr, Ytr), with each row of Xtr being a vectorized 16x16 grayscale image of a digit, and Ytr the vector of class labels. You will train a model on the given data, which will subsequently

sigma = 0.1;
lambda = 0.02;
kernel = 'gaussian' ;
w = regularizedKernLSTrain(Xtr, Ytr, kernel, sigma, lambda);
Ypred = regularizedKernLSTest(w, Xtr, kernel, sigma, Xts);
Note: The parameters (in the given example: sigma, lambda and the kernel type ) must be constants (scalars and strings) and the script must contain only the train and test functions of one of the algorithms specified above (in kNN they are condensed in one function).