Re: on the right track?
I verified for 0 versus 7 case and I am getting exactly same number of support vectors. (and also Ein and Eout)
Haven't explored using sv coefficients for calculating the error. I am using this API: double svm_predict(const struct svm_model *model, const struct svm_node *x); from 'svm.h' that returns the predicted class value. I am calling this method in loop for all the test points and comparing against the ground truth (y array from svm_problem) to compute Ein or Eout. 
Re: on the right track?
Thanks, thanks, thanks!
Like Ivan Keller, I at first wasn't setting the gamma and coef0 parameters. I know what gamma is for the radial kernel, but what does it mean for the polynomial kernel? And what is coef0? The bias? If so, why would the default be 0? Wouldn't you usually want an intercept? 
Re: on the right track?
Quote:
also, from the python docs:   kernel : string, optional (default='rbf')  Specifies the kernel type to be used in the algorithm.  It must be one of 'linear', 'poly', 'rbf', 'sigmoid', 'precomputed' or  a callable.  If none is given, 'rbf' will be used. If a callable is given it is  used to precompute the kernel matrix.   degree : int, optional (default=3)  Degree of kernel function.  It is significant only in 'poly' and 'sigmoid'.   gamma : float, optional (default=0.0)  Kernel coefficient for 'rbf' and 'poly'.  If gamma is 0.0 then 1/n_features will be used instead.   coef0 : float, optional (default=0.0)  Independent term in kernel function.  It is only significant in 'poly' and 'sigmoid'. 
Re: on the right track?
Quote:
If my understanding is correct, the support vectors are some points from the input data set (in particular, the points that are "supporting" the decision boundary.) So I expect that the support vectors that are being reported in the model file should be found in the raw training data. But for some reason, I do not see that. None of the support vectors that the package calculates are in the raw data. Am I missing something? How would one go about constructing the final hypothesis from the support vectors and coefficients that are reported in the model file? 
Re: on the right track?
Now I have a different problem (sorry to bug you all, thanks for your help). I'm getting the right (or at least, the same) results as the rest of you. But now I can't get answers to Q5 and Q6. I'm getting more than one statement being true, and numbers are not increasing/decreasing monotonically.
Suggestions? Hints? 
Re: on the right track?
Never mind: "goes down" is to be interpreted as "goes down monotonically".

Re: on the right track?
As per another thread, when it says it goes up or goes down, it means it goes strictly, not monotonically.

Re: on the right track?
Right. Strictly, that's what I meant to say.

Re: on the right track?
Quote:

All times are GMT 7. The time now is 12:47 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. AbuMostafa, Malik MagdonIsmail, and HsuanTien Lin, and participants in the Learning From Data MOOC by Yaser S. AbuMostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.