linkedin / linkedin/FastTreeSHAP

FastTreeSHAP summary_plot plots interaction value instead of impact on model output

Open
#29 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
566
Forks
38
PR merge metrics
No merged PRs in 30d

Description

I am using `FastTreeSHAP` to help explained my random forest model prediction having over 40K samples and 24 features.
```
explainer = fasttreeshap.TreeExplainer(model, algorithm='auto' ,n_jobs=-1)
shap_values = explainer(X_test).values

shap_values.shape
(40682, 24, 5)

# plotting
fasttreeshap.summary_plot(shap_values, X_test, plot_type = 'bar')
```

The output figure is (showing top-5 features interaction):

![Screenshot 2023-07-05 at 14 50 08](https://github.com/linkedin/FastTreeSHAP/assets/42409395/8a7a494b-d8be-4f02-9f5b-6190aab6b1c8)

I expected output figure to look similar to below image (FastTreeSHAP docs).

![Screenshot 2023-07-05 at 14 51 23](https://github.com/linkedin/FastTreeSHAP/assets/42409395/d2b4579d-2572-4730-b143-cad02ddc7b68)

Is there any change in the `summary_plot()` method?

Contributor guide

Open the contributing guide

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 with fasttreeshap.summary_plot() using the reproduced 3-D shap_values shape and the bar plot example in the issue. Compare the generated feature ranking with the documented expected output, then verify that the completed behavior represents impact on model output rather than interaction values.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.