Added support for
"model_fit" objects from the parsnip package.
"lm" method for
vi_model() gained a new
type argument that allows users to use either (1) the raw coefficients if the features were properly standardized (
type = "raw"), or (2) the absolute value of the corresponding t- or z-statistic (
type = "stat", the default) (#77).
pred_wrapper arguments to
vi_permute() are no longer optional.
vip() function gained a new argument,
geom, for specifying which type of plot to construct. Current options are
geom = "col" (the default),
geom = "point",
geom = "boxplot", or
geom = "violin" (the latter two only work for permutation-based importance with
nsim > 1) (#79). Consequently, the
bar argument has been removed.
vip() function gained two new arguments for specifying aesthetics:
aesthetics (for fixed aesthetics like
color = "red"). Consequently, the arguments
fill, etc. have been removed (#80).
An example illustrating the above two changes is given below:
# Load required packages library(ggplot2) # for `aes_string()` function # Load the sample data data(mtcars) # Fit a linear regression model model <- lm(mpg ~ ., data = mtcars) # Construct variable importance plots p1 <- vip(model) p2 <- vip(model, mapping = aes_string(color = "Sign")) p3 <- vip(model, type = "dotplot") p4 <- vip(model, type = "dotplot", mapping = aes_string(color = "Variable"), aesthetics = list(size = 3)) grid.arrange(p1, p2, p3, p4, nrow = 2)
vip()function gained a new argument,
include_type, which defaults to
TRUE, the type of variable importance that was computed is included in the appropriate axis label. Set
include_type = TRUEto revert to the old behavior.
The internal (i.e., not exported)
get_feature_names() function does a better job with
"nnet" objects containing factors. It also does a better job at extracting feature names from model objects containing a
Removed warnings from experimental functions.
Added support for GLMNET models fit using the glmnet package (with and without cross-validation).
pred_fun argument in
vi_permute() has been changed to
Only the predicted class probabilities for the reference class are required (as a numeric vector) for binary classification when
metric = "auc" or
metric = "logloss".
vi_permute() gained a new logical
keep argument. If
TRUE (the default), the raw permutation scores from all
nsim repetitions (provided
nsim > 1) will be stored in an attribute called
vip() gained new logical arguments
jitter which help to visualize the raw permutation scores for all
nsim repetitions (provided
nsim > 1).
You can now pass a
type argument to
vi_permute() specifying how to compare the baseline and permuted performance metrics. Current choices are
"difference" (the default) and
Greatly improved the documentation for
vi_model() and the various objects it supports.
Added support for Spark (G)LMs.
pkgdown site: https://github.com/koalaverse/vip.
truncate_feature_names argument of
abbreviate_feature_names which abbreviates all feature names, rather than just truncating them.
New vignette on using
vip with unsupported models (using the Keras API to TensorFlow as an example).
Added basic sparklyr support.
Added support for XGBoost models (i.e., objects of class
Added support for ranger models (i.e., objects of class
Added support for random forest models from the
party package (i.e., objects of class
vip() gained a new argument,
num_features, for specifying how many variable importance scores to plot. The default is set to
. 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).