summarise_importance: Append a tibble of variable importances returned by...

View source: R/summarise_boots.R

summarise_importanceR Documentation

Append a tibble of variable importances returned by vi_boots() with upper and lower bounds.

Description

Append a tibble of variable importances returned by vi_boots() with upper and lower bounds.

Usage

summarise_importance(.data, interval_width = 0.95, conf = NULL)

summarize_importance(.data, interval_width = 0.95, conf = NULL)

Arguments

.data

a tibble of variable importances returned by vi_boots().

interval_width

a value between (0, 1) specifying the interval range.

conf

deprecated - please use interval_width instead.

Details

Generates a summary of variable importances with an upper and lower interval range. Uses the vi() function from the {vip} package to compute variable importances (not all model types are supported by vip::vi(); please refer to {vip} package documentation for supported model types). Presently, the quantile() function from the {stats} package is used to determine the lower, 50th percentile, and upper interval ranges.

Examples

## Not run: 
library(tidymodels)

# setup a workflow without fitting
wf <-
  workflow() %>%
  add_recipe(recipe(qsec ~ wt, data = mtcars)) %>%
  add_model(linear_reg())

# evaluate variable importance from 2000 models fit to mtcars
set.seed(123)
importances <-
  wf %>%
  vi_boots(n = 2000, training_data = mtcars, new_data = mtcars)

# append with lower and upper bound importance summary columns
importances %>%
  summarise_importance(interval_width = 0.95)

## End(Not run)

workboots documentation built on May 16, 2022, 9:05 a.m.