Solved – Variable importance for SVM regression and averaged neural networks

importanceneural networksrsvm

Is there any way to calculate variable importance in R for SVM regression and averaged neural networks?

I've been using caret package, that has varImp function in it

> m <- best.tune(svm, train.x = descr[rownames(tr[[i]]),2:ncol(descr)], 
train.y = tr[[i]][,1],  data = df, cost = 2^(seq(0,10,5))), 
tunecontrol = tune.control(sampling = "cross"))
> varImp(m)
 Error in UseMethod("varImp") : 
 no applicable method for 'varImp' applied to an object of class "svm"

According to the developer, this approach wasn't realized for SVM method

However, rminer package suggests such function as Importance. Though, it throws an error:

VariableImportance = Importance(svmFit, data=descr[rownames(tr[[i]]), 2:ncol(descr)],    
                                method="1D-SA")
Error in Importance(svmFit, data = descr[rownames(tr[[i]]), 2:ncol(descr)],  : 
duplicate 'switch' defaults: 'lm == func...' and 'NULL'

Best Answer

You might take a look at this blog post on variable importance for neural network which also gives you ideas for graphical representation of NN with VI. Also see this Cross Validated question on VI for SVM and answers therein. You could calculate your VI for each of your set of models and take a look at the set of VIs across the board.