You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A pain-point in using {kernelshap} is the manual preparation of the background data bg_X. Most applications have a relatively large explanation data X and a model m, but no background data. It would be convenient to derive the background data automatically from X, so that a SHAP analysis would start with:
shp <- kernelshap(m, X)
Suggestion: Set the default bg_X = NULL. In this case, use this logic here:
If nrow(X) <= 200 -> bg_X = X
If nrow(X) < 20 -> warning("X is to small to be used as background data. Please pass a larger background data via 'bg_X'.")
If nrow(X) > 200 -> message("X is too large to be used as background data. We randomly select 200 rows from it.") and do subsampling
If bg_X = NULL and the user wants to pass a vector of case weights bg_w, the latter would need to correspond to X (we need to subsample correspondingly)
A pain-point in using {kernelshap} is the manual preparation of the background data
bg_X
. Most applications have a relatively large explanation dataX
and a modelm
, but no background data. It would be convenient to derive the background data automatically fromX
, so that a SHAP analysis would start with:Suggestion: Set the default
bg_X = NULL
. In this case, use this logic here:nrow(X) <= 200
->bg_X = X
nrow(X) < 20
-> warning("X is to small to be used as background data. Please pass a larger background data via 'bg_X'.")nrow(X) > 200
-> message("X is too large to be used as background data. We randomly select 200 rows from it.") and do subsamplingIf
bg_X = NULL
and the user wants to pass a vector of case weightsbg_w
, the latter would need to correspond toX
(we need to subsample correspondingly)Ping @pbiecek
The text was updated successfully, but these errors were encountered: