Steve,

That doesn't work.

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.

--
Noah

On 8/30/09 7:47 PM, Steve Lianoglou wrote:
Hi,

On Sun, Aug 30, 2009 at 6:10 PM, Noah Silverman<n...@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



______________________________________________
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.

Reply via email to