O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Variable influence plot

Now we can run our variable influence plot. The following plot indicates high cholesterol and family history as the most important variables:

require(randomForest) fit <- randomForest(factor(heartdisease)~., data=heart,ntree=1000) (VI_F <- importance(fit)) varImpPlot(fit,type=2,main="Random Forest Variable Importance Plot - Heart Disease Simulation") 

 

A downside to this method is that it is treating each variable individually, and not considering any correlation between two variables.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required