[R] SVM coefficients

Steve Lianoglou mailinglist.honeypot at gmail.com
Mon Aug 31 04:47:07 CEST 2009


Hi,

On Sun, Aug 30, 2009 at 6:10 PM, Noah Silverman<noah at smartmediacorp.com> wrote:
> Hello,
>
> I'm using the svm function from the e1071 package.
>
> It works well and gives me nice results.
>
> I'm very curious to see the actual coefficients calculated for each input
> variable.  (Other packages, like RapidMiner, show you this automatically.)
>
> I've tried looking at attributes for the model and do see a "coefficients"
> item, but printing it returns an NULL result.

Hmm .. I don't see a "coefficients" attribute, but rather a "coefs"
attribute, which I guess is what you're looking for (?)

Run "example(svm)" to its end and type:

R> m$coefs
             [,1]
 [1,]  1.00884130
 [2,]  1.27446460
 [3,]  2.00000000
 [4,] -1.00000000
 [5,] -0.35480340
 [6,] -0.74043692
 [7,] -0.87635311
 [8,] -0.04857869
 [9,] -0.03721980
[10,] -0.64696793
[11,] -0.57894605

HTH,

-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




More information about the R-help mailing list