Hello,

I am new to data mining and wanted to see a easy to understand implementation of a linear SVM.

  1. Please let me know if there is some easy to understand linear SVM implementations in MATLAB.

  2. I found a quick implemnetation of SVM in MATLAB at ( http://www.cs.cmu.edu/~ggordon/SVMs/svm.m), I did read the warning saying this is not the best way to learn SVM. But I would say this is the easiest code I have come across to understand implmentation of SVM. Saying that I have few questions and wondering if you could help me with that.

H = G . (y * y'); hess = [H -y; -y' 0]; grad = [1 - Halpha + lambday; alpha'y];

as for as I understand Hessian is a Second derivative, how is this calculating the second derivative and also how is the Gradient calculated here. ( apologies for such basic questions)

it would be great if you could help me to understand this following piece of the code, as to what is it accomplishing and why is precond being calculated for newton method. precond = [(alpha/C) . (1-alpha/C); 1]; hess = hess . (precond * precond'); hess(dg) = hess(dg) + mu * ((C-alpha).^2 + alpha.^2)/C^4; rhs = grad . precond + (mu/C) * [1 - 2alpha/C; 0];

Thanks, Lakshmi

asked Feb 09 at 19:11

lakshmi's gravatar image

lakshmi
1111


One Answer:

The code you provide is an implementation of interior point method. Interior point method is rarely used in svm optimization, if any. I think pegasos is the most simple linear svm you can find. http://www.cs.huji.ac.il/~shais/code/index.html Do not panic at the c implementation. The matlab code requires less than 20 lines. Or you may find one in mathworks file exchange.

answered Feb 12 at 12:50

shaw's gravatar image

shaw
1

Your answer
toggle preview

powered by OSQA

User submitted content is under Creative Commons: Attribution - Share Alike; Other things copyright (C) 2010, MetaOptimize LLC.