Extract SHAP values in the context of a nested k-fold cross-validated machine learning model in R?
To compute the variable importance of a random forest model with a continuous outcome, I want to compute the SHAP values on training and set at each fold of a nested k-fold cross-validation process and average them. This has been done by Scheda and al. and seems to be easily done in Python. However, there seems to be no easy way to accomplish this in R. Here is a schema of what I’m trying to do, based on Scheda and al., but only for the training set (as they do for both in their article).
Extract SHAP values in the context of a k-fold cross-validated machine learning model in R?
To compute the variable importance of a random forest model with a continuous outcome, I want to compute the SHAP values on training and test sets at each fold of a k-fold cross-validation process and average them. This has been done by Scheda and al. and seems to be easily done in Python. However, there seems to be no easy way to accomplish this in R. Here is a schema of what I’m trying to do, based on Scheda and al.