Search
Program:
Downloads:
Likely, you will not manage to finish the implementation of all the functions during the excercise in the lab. Finish them as a home work.
Refresh your knowledge of
We may find useful a simple function which would homogenize our data.
Create function with the following prototype:
function xh = homog(x)
x
xh
Assume we have a linear classifier represented by a weight vector w and we would like to use this classifier on new data.
w
function yp = predClassLinear(model, x)
model
yp
We have training data (matrix x and vector y) and we want to use the perceptron algorithm to learn a weight vector w of the linear classifier
y
function model = trainClassLinearPerceptron(x, y)
Apply the perceptron learning algorithm on the hand-written digits datatset. Each digit is represented as a picture in a grid of 8×8 pixels, each pixel can have value from 0 to 16 describing the shade of gray. 65th feature is the true class, i.e. the number depicted in the picture.
Since our algorithm can work with binary classification only, choose 2 classes (e.g. 1 and 8, or 1 and 7, or 3 and 8) and try to train a linear classifier able to distinguish both classes. Study error rate and confusion matrix on training and testing data.
Further assignments: