This function is used to calculate permutational feature importance using an aggregate (for now only integral) of a time dependent metric. The result is the combined change in loss function across all time points - a single value.

surv_integrated_feature_importance(
  x,
  loss_function = DALEX::loss_root_mean_square,
  ...,
  type = c("raw", "ratio", "difference"),
  B = 10,
  variables = NULL,
  variable_groups = NULL,
  N = NULL,
  label = NULL
)

Arguments

x

an explainer object - model preprocessed by the explain() function

loss_function

a function that will be used to assess variable importance, by default loss_brier_score for survival models. The function should take can be supplied manually but has to have these named parameters (y_true, risk, surv, times), where y_true represents the survival::Surv object with observed times and statuses, risk is the risk score calculated by the model, and surv is the survival function for each observation evaluated at times

...

other parameters, currently ignored

type

a character vector, if "raw" the results are losses after the permutation, if "ratio" the results are in the form loss/loss_full_model and if "difference" the results are of the form loss - loss_full_model`

B

numeric, number of permutations to be calculated

variables

a character vector, names of variables to be included in the calculation

variable_groups

a list of character vectors of names of explanatory variables. For each vector, a single variable-importance measure is computed for the joint effect of the variables which names are provided in the vector. By default, variable_groups = NULL, in which case variable-importance measures are computed separately for all variables indicated in the variables argument

N

numeric, number of observations that are to be sampled from the dataset for the purpose of calculation

label

label of the model, if provides overrides x$label

Value

A data.frame containing results of the calculation.

Details

Note: This function can be run within progressr::with_progress() to display a progress bar, as the execution can take long, especially on large datasets.