$24
(Q1) [25 Marks] Data in the file linear is given in the form (xi; yi)ni=1, where xi 2 R, and yi 2 R. P
Li(w) = (w(1)xi + w(2) yi)2.
(Q2) [25 Marks] Data in the file logistic is given in the form (xi; yi)ni=1, where xi 2 R2, and yi 2
f 1; +1g. Let w = (w(1); w(2); w(3)) 2 R3. Let (w>x) = 1
1+exp( (w(1)x(1)+w(2)x(2)+w(3)))
be the likelihood that example x belongs to class +1. Learn the optimal w for loss function L(w) = Pi Li(w), where Li(w) = log (yiw>xi). [25 Marks]
(Q3) [50 Marks] import the MNIST dataset (link: http://yann.lecun.com/exdb/mnist/), and use logistic regression to classify digits 4 versus 7.