model_parts.R
R/surv_integrated_feature_importance.R
surv_integrated_feature_importance.Rd
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
)
an explainer object - model preprocessed by the explain()
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
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`
numeric, number of permutations to be calculated
a character vector, names of variables to be included in the calculation
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
numeric, number of observations that are to be sampled from the dataset for the purpose of calculation
label of the model, if provides overrides x$label
A data.frame containing results of the calculation.
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.