I searched for how to find feature weights and found this stackoverflow answer. It gives the following equation to get the weights:

w = t(model$coefs) %*% model$SV

The answer mentions that the method is for SVM with linear kernel. Can I use the same equation for radial? Why or Why not?


No you cannot, because for the RBF kernel $\mathbf{w}$ can never be computed explicitly since it is infinite dimensional.

$\mathbf{w}$ is the separating hyperplane in feature space, which for the linear kernel happens to be input space. The only thing you can compute is an inner product between $\mathbf{w}$ and some test instance in feature space via the kernel trick.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.