[R] Manually calculate SVM

Steve Lianoglou mailinglist.honeypot at gmail.com
Thu Mar 25 23:33:07 CET 2010


> 1) how calculation of the kernel happens.

The kernel is just a "normal function" (though not every function is a
proper kernel function): it takes two values (each value being a
vector (or something) representing an example) and returns a real
valued answer.

> 2) how to calculate the predicted value (y_hat) given a list of support
> vectors and coefficients.

Sum over all S support vectors (SV): coef_s * label_s *
kernel_function(SV_s, example)
Then add the bias term to that value

> I've seen all the formulas and many of the books.  I get most of it
> conceptually.  Where I'm having trouble is making the leap from concept
> to actual use.  Ideally, I'd love to code some of the basic stuff in R
> or Perl in scratch.  It won't be efficient, but will better help me
> understand just how actual values are manipulated.
> I know this isn't the function of the list, but was hoping that someone
> could point me toward some good resources or offer some suggestion.

Go watch Andrew Ng's Machine Learning lectures (they are free online).
I think even one of his homework problems was to implement a "simple"
SVM solver (though I could be mistaken)

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the R-help mailing list