py-why / py-why/EconML

Beeswarm SHAP plot produces a different output at each execution

Open
#478 0 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

I train a CausalForestDML as follows;

est_forest = CausalForestDML(random_state = 123)
est_forest.fit(Y, T, X = W, W = W, inference = 'auto'),

and then compute the Shapley values:
shap_values = est_forest.shap_values(W).
This works fine, except that the beeswarm plot is different each time I execute:
shap.plots.beeswarm(shap_values['log_price_m2']['log_listings_iris'], max_display = 20).
I understand that this is a problem with the SHAP package, but still I think you would like to know about this unintended behavior, and may be you may have an explanation for it.
Thank you.

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

Start by reproducing the issue with CausalForestDML(random_state=123), est_forest.shap_values(W), and shap.plots.beeswarm(...). Inspect the EconML SHAP-value path and the SHAP beeswarm behavior to determine where the output changes between executions. Done means identifying whether EconML or SHAP causes the variation and documenting or correcting the behavior accordingly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.