I am trying to extract weights for R's ksvm package.
Usually I use the e1071 package and the weights can be computed by
weights = t(svmmodel$coefs) %*% svmmodel$SV
However, when I look into the ksvm package, both the coefficients and alphas (support vectors) are lists of the same dimension. The alphas do not return vectors.
My question is, how should I access the support vectors including the zero values? Would I have to use SVindex to correspond the variables back to the original input?
Thanks.