Learn R Programming

radiant.model (version 1.6.12)

vi_radiant: Compute permutation-based variable importance

Description

Internal replacement for vip::vi(..., method = "permute") that supports the "rsq" and "roc_auc" metrics used in radiant.model. No external package dependencies are required.

Usage

vi_radiant(
  object,
  target,
  method = "permute",
  metric,
  pred_wrapper,
  train,
  event_level = NULL,
  nsim = 3L,
  ...
)

Value

A data frame with columns Variable and Importance

(and class c("vi","data.frame")).

Arguments

object

A fitted model object.

target

Character string naming the response column in train.

method

Must be "permute" (only supported method).

metric

Character string; either "rsq" or "roc_auc".

pred_wrapper

A function with arguments object and newdata that returns a numeric prediction vector.

train

Data frame containing both features and the target column.

event_level

"first" (default) or "second"; which factor level of target is the positive class (used for "roc_auc").

nsim

Number of permutation replications per feature; results are averaged across replications. Default is 3.

...

Ignored.