SVM importance of predictor variables

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?

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.

• Wouldn't the varImp() function work in that case? – GuillaumeL Nov 5 '20 at 13:31

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

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