-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aggregate local_interactions to estimate shap with interactions #91
Comments
Hi, library("DALEX")
library("iBreakDown")
set.seed(1313)
model_titanic_glm <- glm(survived ~ .,
data = titanic_imputed, family = "binomial")
explain_titanic_glm <- explain(model_titanic_glm,
data = titanic_imputed[,-8],
y = titanic_imputed$survived,
label = "glm")
bd_glm <- local_interactions(explain_titanic_glm, titanic_imputed[1, ], order=6:1)
bd_glm
bd_glm <- local_interactions(explain_titanic_glm, titanic_imputed[1, ], order=1:6)
bd_glm
bd_glm <- local_interactions(explain_titanic_glm, titanic_imputed[1, ], order=c('age:gender', 'class', 'embarked', 'fare', 'sibsp'))
bd_glm
bd_glm <- local_interactions(explain_titanic_glm, titanic_imputed[1, ], order=c('age:gender', 'embarked:class', 'sibsp:fare'))
bd_glm Estimation of SHAP by repeating contributions over different orders is possible using the |
Thanks Hubert! I tried your example and it indeed works fine :) However, when passing an order with all variables and possible interactions, I do not get any interaction anymore but only the contributions of single variables. Is it that not all interactions can be passed to the function? And thanks for pointing to the |
I believe that each variable can be mentioned only once e.g. if As for SHAP with interactions, I think that it would be a great feature/method to consider. |
I see, thanks Hubert for the clarification! And so not all pairwise interactions can be assessed nor single and interactions.. That could also be a nice feature too :) |
I think this could remain open |
Hi,
Thanks for the package! I was wondering how is the variable order set when calculating the local interactions and if there could be a way to randomize that order to repeat the measure of the contribution for different orders (and get an estimation of the contribution closer to what SHAP would output)?
I tried passing different orders of variables to local_interactions(..., order =) but it does not change anything, and so I don't know if I am missing a step.. ?
Script example:
The text was updated successfully, but these errors were encountered: