Variable Importance Plots

A general framework for constructing variable importance plots from various types of machine learning models in R. Aside from some standard model- specific variable importance measures, this package also provides model- agnostic approaches that can be applied to any supervised learning algorithm. These include 1) an efficient permutation-based variable importance measure, 2) variable importance based on Shapley values (Strumbelj and Kononenko, 2014) , and 3) the variance-based approach described in Greenwell et al. (2018) . A variance-based method for quantifying the relative strength of interaction effects is also included (see the previous reference for details).

CRAN_Status_Badge Travis-CI BuildStatus AppVeyor BuildStatus CoverageStatus CRAN RStudio mirrordownloads TotalDownloads lifecycle


vip is an R package for constructing variable importance plots (VIPs). VIPs are part of a larger framework referred to as interpretable machine learning (IML), which includes (but not limited to): partial dependence plots (PDPs) and individual conditional expectation (ICE) curves. While PDPs and ICE curves (available in the R package pdp) help visualize feature effects, VIPs help visualize feature impact (either locally or globally). An in-progress, but comprehensive, overview of IML can be found here:


# The easiest way to get vip is to install it from CRAN:
# Alternatively, you can install the development version from GitHub:
if (!requireNamespace("devtools")) {

For details and example usage, visit the vip package website.


vip 0.1.2

  • Added support for Spark (G)LMs.

  • Bux fixes.

vip 0.1.1

  • Fixed bug in get_feature_names.ranger() s.t. it never returns NULL; it either returns the feature names or throws an error if they cannot be recovered from the model object (#43).

  • Added pkgdown site:

  • Changed truncate_feature_names argument of vi() to abbreviate_feature_names which abbreviates all feature names, rather than just truncating them.

  • Added CRAN-related badges (#32).

  • New generic vi_permute() for constructing permutation-based variable importance scores (#19).

  • Fixed bug and unnecessary error check in vint() (#38).

  • New vignette on using vip with unsupported models (using the Keras API to TensorFlow as an example).

  • Added basic sparklyr support.

vip 0.1.0

  • Added support for XGBoost models (i.e., objects of class "xgb.booster").

  • Added support for ranger models (i.e., objects of class "ranger").

  • Added support for random forest models from the party package (i.e., objects of class "RandomForest").

  • vip() gained a new argument, num_features, for specifying how many variable importance scores to plot. The default is set to 10.

  • . was changed to _ in all argument names.

  • vi() gained three new arguments: truncate_feature_names (for truncating feature names in the returned tibble), sort (a logical argument specifying whether or not the resulting variable importance scores should be sorted), and decreasing (a logical argument specifying whether or not the variable importance scores should be sorted in decreasing order).

  • vi_model.lm(), and hence vi(), contains an additional column called Sign that contains the sign of the original coefficients (#27).

  • vi() gained a new argument, scale, for scaling the variable importance scores so that the largest is 100. Default is FALSE (#24).

  • vip() gained two new arguments, size and shape, for controlling the size and shape of the points whenever bar = FALSE (#9).

  • Added support for "H2OBinomialModel", "H2OMultinomialModel", and, "H2ORegressionModel" objects (#8).

vip 0.0.1

  • Initial release.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.3.2 by Brandon Greenwell, 10 months ago

Report a bug at

Browse source code at

Authors: Brandon Greenwell [aut, cre] , Brad Boehmke [aut] , Bernie Gray [aut]

Documentation:   PDF Manual  

GPL (>= 2) license

Imports ggplot2, gridExtra, magrittr, plyr, stats, tibble, utils

Suggests DT, C50, caret, Ckmeans.1d.dp, covr, Cubist, doParallel, dplyr, earth, fastshap, gbm, glmnet, h2o, htmlwidgets, keras, knitr, lattice, mlbench, mlr, mlr3, neuralnet, NeuralNetTools, nnet, parsnip, party, partykit, pdp, pls, randomForest, ranger, rmarkdown, rpart, RSNNS, sparkline, sparklyr, tinytest, varImp, xgboost

Imported by moreparty, prettyglm.

Suggested by ENMTools, easyalluvial, gbm, pdp, tabnet, vivid.

See at CRAN