2
$\begingroup$

I am building a model in R using support vector machine (SVM) with KBF kernel. The model seems to work quite well. I would like to assess the relative importance of predictor variables.

Can anyone tell me how this can done. Does there exist an R script for that?

$\endgroup$
1
1
$\begingroup$

Unfortunately, there is no direct way to get such information with SVMs, in contrast to, for example, logistic regression.

If you want, you can estimate the contribution of a single predictor ad hoc by training a model on all predictors except that specific predictor. The difference in performance between that model and the one with all predictors may then be considered the marginal contribution of that predictor.

If time permits, you can perform this procedure for all predictors.

$\endgroup$
1
  • $\begingroup$ Wouldn't the varImp() function work in that case? $\endgroup$ – GuillaumeL Nov 5 '20 at 13:31
0
$\begingroup$

If you use R, the variable importance can be calculated with Importance method in rminer package. This is my sample code:

library(rminer)
M <- fit(y~., data=train, model="svm", kpar=list(sigma=0.10), C=2)
svm.imp <- Importance(M, data=train)

In detail, refer to the following link https://cran.r-project.org/web/packages/rminer/rminer.pdf

$\endgroup$
1
  • $\begingroup$ Can you expand a bit on how it does it as if the link goes dead your answer will become worthless? $\endgroup$ – mdewey Sep 14 '17 at 15:21

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.