Skip to content
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

Adjusting number of features shown #4

Closed
coulls opened this issue Oct 24, 2017 · 7 comments
Closed

Adjusting number of features shown #4

coulls opened this issue Oct 24, 2017 · 7 comments
Labels
stale Indicates that there has been no recent activity on an issue

Comments

@coulls
Copy link

coulls commented Oct 24, 2017

When visualizing a single prediction, it appears as though the IML visualizer decides how many feature names to put in the chart. It would be great if we had more control over the features shown. For instance, showing only the top-n features for both the positive and negative direction.

Is it possible to achieve this in the code as it stands or do it require deep changes to IML?

@slundberg
Copy link
Collaborator

slundberg commented Oct 24, 2017

That would not be a huge change, but it will need to be made in the JS code in IML. If it's important to you let me know, and I'll leave it here as a to-do when I get time. (or a PR to IML is also welcome)

@coulls
Copy link
Author

coulls commented Oct 24, 2017

Thanks! I do think it would be super helpful. Our model has nearly 3,000 features, so visualizing the whole range for a single prediction is kind of difficult to read. I have tried to limit the number of features, though obviously that impacts the predicted score that is displayed, etc.

Something that essentially 'zooms in' on the area around the predicted score would be nice.

@slundberg
Copy link
Collaborator

slundberg commented Oct 25, 2017 via email

@coulls
Copy link
Author

coulls commented Oct 31, 2017

Apologies for the delay in getting back to you. Attached are two examples of the single prediction visualization using my ~3,000 features. The predictions are the same sample with the same feature set under two different LightGBM models.

I've anonymized the one displayed feature name, so I hope that doesn't impact anything on your end.

As you can see, there is quite the long-tail of minor contributors in the visualization, so the amount of information that can be retrieved by the viewer at this level of detail is quite low. It would be nice if there was a 'zoom' functionality that let us focus on the top-N features, or something similar to that. As I said before, I tried to do this artificially by recreating a truncated SHAP vector, but then the totals are obviously incorrect -- I suppose I could just sum all of the remaining feature contributions up into a single catch-all feature for both sides of the force diagram, but that seems like something that perhaps should be handled under the hood (and certainly not something that will work in general).

Separately, there have been some issues with placement of the names, though I fully realize part of that is due to their length. In this example, one model's visualization output can only fit a single name and the other didn't place any of the feature names.

screen shot 2017-10-30 at 10 30 02 pm

screen shot 2017-10-30 at 10 29 51 pm

@slundberg
Copy link
Collaborator

slundberg commented Oct 31, 2017 via email

slundberg pushed a commit that referenced this issue Dec 3, 2020
dwolfeu pushed a commit to dwolfeu/shap that referenced this issue May 22, 2023
* tests: vertically center heatmap shap#4

* fix: update baseline images shap#4

* fix: add in missing color bar

* fix: color bar on test_heatmap_feature_order

* chore: use show=False to suppress display warning
Copy link

github-actions bot commented Dec 8, 2023

This issue has been inactive for two years, so it's been automatically marked as 'stale'.

We value your input! If this issue is still relevant, please leave a comment below. This will remove the 'stale' label and keep it open.

If there's no activity in the next 90 days the issue will be closed.

@github-actions github-actions bot added the stale Indicates that there has been no recent activity on an issue label Dec 8, 2023
Copy link

github-actions bot commented Mar 8, 2024

This issue has been automatically closed due to lack of recent activity.

Your input is important to us! Please feel free to open a new issue if the problem persists or becomes relevant again.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Indicates that there has been no recent activity on an issue
Projects
None yet
Development

No branches or pull requests

2 participants