[R] SVM coefficients

Steve Lianoglou mailinglist.honeypot at gmail.com
Mon Aug 31 16:33:04 CEST 2009


On Aug 31, 2009, at 3:32 AM, Noah Silverman wrote:

> Steve,
> That doesn't work.

Actually, it does :-)

> I just trained an SVM with 80 variables.
> svm_model$coefs gives me  a list of 10,000 items.  My training set  
> is 30,000 examples of 80 variables, so I have no idea what the  
> 10,000 items represent.
> There should be some attribute that lists the "weights" for each of  
> the 80 variables.

No, not really.

The coefficients that you're pulling out are the weights for the  
support vectors. These aren't the coefficients you're expecting as in  
the "normal" linear model case, or whatever.

I guess you're using the RBF kernel, right? The 80 variables that  
you're using are being transformed into some higher dimensional space,  
so the 80 weights you expect to get back don't really exist in the way  
you're expecting.

SVMs are great for accuracy, but notoriously hard for interpretation.

To try and squeeze some interpretability from your classifier in your  
feature space, you might try to look at the weights over your w vector:



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