Question: 15.2 Least squares classification with regularization. The file Isq_classifier_data. jl contains feature n-vectors 21, ... . N, and the associated binary labels, /1, . ..,

 15.2 Least squares classification with regularization. The file Isq_classifier_data. jl contains

15.2 Least squares classification with regularization. The file Isq_classifier_data. jl contains feature n-vectors 21, ... . N, and the associated binary labels, /1, . .., yw, each of which is either +1 or -1. The feature vectors are stored as an n x / matrix X with columns 21, ..., IN, and the labels are stored as an N-vector y. We will evaluate the error rate on the (training) data X, y and (to check if the model generalizes) a test set Xtest, ytest, also given in 1sq_classifier_data. jl. You may use LinearLeastSquares for all parts of the problem. Include your Julia code in your solution. (a) Least squares classifier. Find B, v that minimize EN(x, B +v-y;) on the training set. Our predictions are then f(x) = sign(xB + v). Report the classification error on the training and test sets, the fraction of examples where f(c;) * yi. There is no need to report the B, v values. (b) Regularized least squares classifier. Now we add regularization to improve the generalization ability of the classifier. Find B, v that minimize N ' allolly + 2 ( 16 - 2 + 8) )3 i-1 where A > 0 is the regularization parameter, for a range of values of A. We suggest the range 10-1 to 104, say, 100 values logarithmically spaced. The function logspace may be useful. Use it to plot the training and test set errors against logo (A). Suggest a reasonable choice of A. Again, there is no need to report the B, v values, just attach the plot and a reasonable value of 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!