Variable Importance Plots

A general framework for constructing variable importance plots from various types machine learning models in R. Aside from some standard model- based variable importance measures, this package also provides a novel approach based on partial dependence plots (PDPs) and individual conditional expectation (ICE) curves as described in Greenwell et al. (2018) .

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.1.2 by Brandon Greenwell, 5 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, ModelMetrics, pdp, plyr, stats, tibble, utils

Suggests C50, caret, Ckmeans.1d.dp, covr, doParallel, dplyr, earth, gbm, glmnet, h2o, keras, knitr, lattice, mlbench, NeuralNetTools, nnet, party, partykit, randomForest, ranger, rmarkdown, rpart, sparklyr, testthat, xgboost

Suggested by pdp.

See at CRAN