![]() |
*ANSWER* Question 9
I wanted to confirm my answer with what others are getting.
I coded up the solution in MATLAB. I seem to have gotten somewhat lucky when I answered [d] for this question, since the ratio from one of the runs was 0.61, which is closer to 70% than 50%. However, I was re-running the code after submission, and it seems that the result fluctuates around 0.6, sometimes dropping below that. My code follows. I would appreciate if anyone has insights as to where I am going wrong. It is most likely in the % Quadratic Programming % section, since PLA is lifted straight from the previous assignments I coded. Code:
|
Re: *ANSWER* Question 9
I had the same situation happened in Python. I'm pretty sure I checked everything for errors. The thing that I changed is, instead of doing
Code:
better = better + (e_svm < e_pla); Code:
better = better + (e_svm <= e_pla); |
Re: *ANSWER* Question 9
Hi,
Sorry for being somewhat late (3 years?) in joining this discussion. I don't have Matlab to verify it, but I've run into a similar problem using Python and CVXOPT. The solution was to increase the number of test points from 10^3 to 10^4, assuming that's the method you use to calculate which result is closer to f. |
All times are GMT -7. The time now is 06:34 PM. |
Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
The contents of this forum are to be used ONLY by readers of the Learning From Data book by Yaser S. Abu-Mostafa, Malik Magdon-Ismail, and Hsuan-Tien Lin, and participants in the Learning From Data MOOC by Yaser S. Abu-Mostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.