View Single Post
Old 05-19-2013, 01:50 PM
PaulN PaulN is offline
Junior Member
Join Date: Apr 2013
Posts: 6
Default Re: Support Vector Machines

Originally Posted by Michael Reach View Post
General question on the homework: Has anyone found a way to test one's answers on these programming assignments, prior to submitting? It's exciting to submit, but I could do with a little more certainty! I'm the lazy sort of programmer - usually I debug afterwards, by seeing if the answer is right.
I cannot say I really tested my implementation of SVM (which uses a QP package) but I did 2 sanity checks:

I fed the SVM implemetation with just 2 points (N=2): (0, 0) and (1, 1) with respective values -1 and 1. Then I made sure I get as the answer the line/vector I expect: -1 + x + y = 0, that is (-1, 1, 1) (Or something very close to that, as they are rounding errors. Also a positive multiple of that vector would do as it specifies the same line/function).

Another thing I do is to always check, programmatically, that the vector/line I get from SVM really separates the N points I give as input (In other words I check that E_in = 0). If it's not the case, I abort the program, since this means there is some flaw in my implementation.
Reply With Quote