Helper functions for predict_parts.R
surv_lime(
explainer,
new_observation,
...,
N = 100,
distance_metric = "euclidean",
kernel_width = NULL,
sampling_method = "gaussian",
sample_around_instance = TRUE,
max_iter = 10000,
categorical_variables = NULL,
k = 1 + 1e-04
)
an explainer object - model preprocessed by the explain()
function
a new observation for which predictions need to be explained
additional parameters, passed to internal functions
a positive integer, number of observations generated in the neighbourhood
character, name of the distance metric to be used, only "euclidean"
is implemented
a numeric or "silverman"
, parameter used for calculating weights, by default it's sqrt(ncol(data)*0.75)
. If "silverman"
the kernel width is calculated using the method proposed by Silverman and used in the SurvLIMEpy Python package.
character, name of the method of generating neighbourhood, only "gaussian"
is implemented
logical, if the neighbourhood should be generated with the new observation as the center (default), or should the mean of the whole dataset be used as the center
a numeric, maximal number of iteration for the optimization problem
character vector, names of variables that should be treated as categories (factors are included by default)
a small positive number > 1, added to chf before taking log, so that weigths aren't negative
A list, with the SurvLIME result in the $result
field.
[1] Kovalev, Maxim S., et al. "SurvLIME: A method for explaining machine learning survival models." Knowledge-Based Systems 203 (2020): 106164.
[2] Pachón-García, Cristian, et al. "SurvLIMEpy: A Python package implementing SurvLIME." Expert Systems with Applications 237 (2024): 121620.