
Compute variable importance using SHAP values
Source:R/machine_learning.R
compute_variable.importance.Rd
Computes the variable importance for a machine learning model using SHAP (SHapley Additive exPlanations) values.
Details
If stacking
is TRUE, the function computes the SHAP values for each base model in the stacked ensemble model and
averages them. If stacking
is FALSE, the function computes the SHAP values for the provided single machine learning model.
The computed SHAP values are returned as a data frame with features as rows and samples as columns.