Skip to content
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

generating SHAP values. #64

Closed
sandeshregmi opened this issue Jan 9, 2020 · 2 comments
Closed

generating SHAP values. #64

sandeshregmi opened this issue Jan 9, 2020 · 2 comments

Comments

@sandeshregmi
Copy link

sandeshregmi commented Jan 9, 2020

Hello,
First of all thank you so much for your contribution for making millions of like me more educated on "Black Box" model.
I have a quick question regarding SHAP values generation using DALEX/ iBreakDown packages.
xgb<-DALEX::explain(xgb_03, data=testing[,1:345],y= testing$TRANSITIONED=="YES", label = "for Member "L00274353401")

ive_xgb <- iBreakDown::shap(xgb, new_observation = filter(testing[,1:345], MEMBER=='TX00274353401'))

When I run this code, first object gets created without problem but for second object (ive_xgb), its still running after three hours. Do you have any suggestion? please
Thank you

@pbiecek
Copy link
Member

pbiecek commented Jan 9, 2020

For complex models it may be slow.
One quick trick is to reduce number of random paths calculated by this function. By default it's 25, you can try B = 5, should be fine for medium or small number of variables in the model (but you have >300 so you need to check if it will be stable).
Second will be to give smaller data to the explain() function.
If testing is very large you can try to use just a subset of data.

@sandeshregmi
Copy link
Author

sandeshregmi commented Jan 9, 2020

I appreciate it. After down-sizing the rows in explainer and setting B=5 in shap function worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants