py-why / py-why/EconML

CausalForestDML SHAP values not working properly

Open
#464 19 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
4.8k
Forks
827
PR merge metrics
No merged PRs in 30d

Description

Hello,

I am using econml version 0.10.0 and shap v. 0.39.0

When I calculate SHAP values for CausalForestDML estimator the results do not make sense, as opposed to when I calculate them the same way on other estimators like DRL/Meta-learners.

Here is a brief description of my issue:

Y = ['event_flag']
T = ['Diabetes_A1c_Test_compliance_category_Non-Compliant']

So I am able to access my shap values using: shap.plots.bar(shap_values[Y[0]][T[0]+'_1.0']) for non-CausalForestDML models, however, for CausalForestDML the shap values take a different form:

shap.plots.bar(shap_values['Y0']['T0_1.0']), even though everything else has been set up the same

Additonally, the results dont make sense:

For example, for DRL I see about what I expect: (clear directional relationships between the impact and the value of the feature, for the most part)
image

But for DML (built the same way, only difference is the estimator used), the results are not at all what I would expect: (very little directional relationships)
image

Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is identified in the report. Start by reproducing the CausalForestDML case with the stated EconML and SHAP versions, then compare its SHAP value structure and plots with the DRL or meta-learner cases using shap.plots.bar. Done is not defined beyond making the CausalForestDML results behave as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.