Solved – SVM in R package e1071

rsvm

I am trying to use SVM to make a prediction (True or False) on a dataset with many independent variables. I am wondering how I can identify the most useful variable in making the prediction. I understand that there is a function that allows me to calculate the "weights" of the variables in R package e1071.

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

But I am not sure how I can decide which are the important variables, based on these weights.

Best Answer

The caret package has useful utilities for variable selection. The rfe function performs recursive feature selection. Reference this answer for a demo: https://stackoverflow.com/a/17530483/819544