
Calculate Variable Importance for a Batch of Samples
calculate_variable_importance_batch.RdThis function calculates SHAP values for a batch of samples using a DALEX explainer. It iterates over the specified number of samples, generates SHAP contributions for each, and aggregates the results into a summary dataframe containing mean SHAP values for each variable and sample. The function also measures the time taken for the entire process.
Usage
calculate_variable_importance_batch(
explainer,
train_data,
target_var,
n_samples,
directory_to_save = NULL
)