causalml
causalml copied to clipboard
SHAP Tree_Explainer failed in notebook
Describe the bug A clear and concise description of what the bug is. The SHAP Tree Explainer function doesn't support causal ml causaltree It is related to issue Issue 3273 To Reproduce Steps to reproduce the behavior: Run notebook Expected behavior A clear and concise description of what you expected to happen. Model type should be supported by TreeExplainer class
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
- OS: [macOS]
- Python Version: [3.9]
Additional context Add any other context about the problem here.
@alexander-pv Hi Alexander, I believe this is related to the PR you submitted to SHAP. We are creating this issue so we can track the progress. Do we have a workaround to run this before they merge the PR?
Hi, @vincewu51! For now, perhaps, the only way is to install this fork from source. I believe causalml support in shap will be added soon enough. I've just closed my debt there.
Ive installed the fork youve mentioned but am still getting
InvalidModelError: Model type not yet supported by TreeExplainer: <class 'causalml.inference.tree.causal.causaltree.CausalTreeRegressor'>
Anything i can do about it?
Hi @AlanGanem, the fork should be working. If not, SHAP package will merge the PR soon. You can track it here:Issue 3273
I have created an issue that similar to your problem => https://github.com/uber/causalml/issues/735
Also I have found a way to plot shap values based on uplift_model.get_shap_values
function but I am not clear how to define base_value that SHAP local plots requires. Any ideas ?
Hi @AlanGanem, the fork should be working. If not, SHAP package will merge the PR soon. You can track it here:Issue 3273
@alexander-pv, can you follow up on this with the SHAP team? Thanks.
Hi, all! Over the past few months, there have been over a hundred commits in shap project, so I updated https://github.com/shap/shap/pull/3273 to speedup the process. The PR is expected to be in the next 0.46.0 shap release according to the milestone.