Ranking the variable importance with the rminer package
Besides using the caret
package to generate variable importance, you can use the rminer
package to generate the variable importance of a classification model. In the following recipe, we will illustrate how to use rminer
to obtain the variable importance of a fitted model.
Getting ready
In this recipe, we will continue to use the telecom churn
dataset as the input data source to rank the variable importance.
How to do it...
Perform the following steps to rank the variable importance with rminer
:
- Install and load the package,
rminer
:> install.packages("rminer") > library(rminer)
- Fit the svm model with the training set:
> model=fit(churn~.,trainset,model="svm")
- Use the
Importance
function to obtain ...
Get R: Recipes for Analysis, Visualization and Machine Learning now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.