-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Using XGboost with Kernel SHAP #179
Comments
Yes you can, you just need to define a prediction function to pass to KernelExplainer. Though of course it will be a worse and much slower estimate than what TreeExplainer would give. |
It give an error as booster object not callable. The model is the model that you have used in medical dataset. |
Right that's because you need to pass a function to KernelExplainer that accepts a numpy array and outputs a vector of model predictions. |
Could you please give an example for your medical scenario?
…On Sat, Jul 28, 2018 at 2:26 AM, Scott Lundberg ***@***.***> wrote:
Right that's because you need to pass a function to KernelExplainer that
accepts a numpy array and outputs a vector of model predictions.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#179 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQSIQHoRiGTayYxTjAqk3afoud2nKiGOks5uKz84gaJpZM4VdQgK>
.
|
I have tried using it givens an error as Provided model function fails when applied to the provided data set. Could you please help me? |
Hi, Do you have any example that you have generate the SHAP values from Tree explainer and Kernel explainer using the same model (Xgboost) Please help me on this. |
@Dilini-Sewwandi-Rajapaksha I am sorry this is causing you trouble. Unfortunately I often can't respond quickly to every issue on here since this is an open source project that I don't maintain as a full time job. The problem with what you posted is something specific to Python, not SHAP. |
Thank you. After you have done with that please send me the link . |
Might be helpful? => How to use XGBoost with Kernel SHAP and Tree SHAP (using the same model) |
Thank you very much @noleto |
thanks! |
@noleto: sweet workaround, thx. Would prefer of course if KernelExplainer would natively deal with pandas dfs. |
Hi, Thank you for the above discussion - I just wanted to agree with Mayer79 as it would be great if one day we could feed the model predictions into Kernel SHAP (instead of the prediction function) as this would allow us to explain models built outside of Python. Thank you Scott for all of your work on SHAP - the package is a game changer and myself and my colleagues are extremely grateful! |
Since @slundberg made it clear how to work with the KernelExplainer and there is provided gist example from @noleto I think we can close the issue for now @thatlittleboy |
Hi,
Can we use xgboost with Kernel SHAP?
Thanks
The text was updated successfully, but these errors were encountered: