|
Hello, I am new to data mining and wanted to see a easy to understand implementation of a linear SVM.
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 |
|
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. |