0

I have the following R code below:

# call ksvm
model <-  ksvm(as.matrix(data[,1:10]),as.factor(data[,11]),type="C- svc",kernel="vanilladot",C=100,scaled=TRUE)

# calculate a1.am
a <- colSums(model@xmatrix[[1]] * model@coef[[1]])

I'm trying to understand what this piece of code is doing:

colSums(model@xmatrix[[1]] * model@coef[[1]])

A detailed breakdown would be appreciated.

PineNuts0
  • 4,740
  • 21
  • 67
  • 112
  • 2
    There are some information on the use of `@` [here](https://stackoverflow.com/questions/1908010/what-does-the-symbol-mean-in-r). Can you add the package for the `ksvm` function and some reproducible data? – bretauv May 16 '20 at 18:40
  • 1
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick May 16 '20 at 19:23

0 Answers0