Hi Marlene,
On Aug 3, 2009, at 8:59 AM, marlene marchena wrote:
Dear R users,
I'm running a SVR in package e1071 but I did not able to calculate the
parameters w and b of the regression. I don't know how to do that
and if it
is possible to do it with this package.
Someone have some idea. Any help would be much appreciated.
While you're not given the W vector directly, you can recover it from
the support vectors, no? In LaTeX form, W looks like:
\vec{W} = \sum_{i=1}^N \alpha_i y_i \vec{x}_i
If "model" was the object returned from your SVM: alpha_i's are the
weights of each vector (model$coefs[i]) and x_i are the support
vectors (model$SV[i,]).
You can use some matrix multiplication to calculate this very quickly:
W <- t(model$coefs) %*% model$SV
By default, the x's and y's are scaled when you call svm(..) so I
think, by definition, your y intercept (b) should be zero. I think the
values in model$y.scale might be what you're looking for, though (not
sure).
Hope that helps,
-steve
--
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
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.