Add support for shap interactive plots
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- machine-learning
Research direction
Start by tracing how dvc_plots/index.html is created and how Studio loads plots; the issue does not name an implementation file. Review SHAP's shap.getjs() and plot HTML output, then determine how both could be embedded and verify that an interactive plot renders in Studio.
Written by the indexing model from the issue text.
Description
Shap is a powerful library for model interpretation that creates interactive plots. These plots can be saved as HTML to embed somewhere else, as long as the required JavaScript is loaded. While exporting the plots as a static image file is possible, some functionality is lost.
I'm unsure of how plots are loaded into Studio, but it seems possible to modify the way dvc_plots/index.html is created to include:
- The JavaScript library of Shap
- The dumped Shap plot HTML
The HTML of the plot can be obtained as follows:
# model: trained model to explain
# X: training data
explainer = shap.TreeExplainer(model)
shap_values = explainer.shap_values(X)
shap_plot = shap.force_plot(explainer.expected_value, shap_values, X)
shap_plot_html = shap_plot.html() # HTML code of the plot
The JavaScript can be obtained with the following command:
shap.getjs()
- Dominant language
- No language data
- Stars
- 17
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from iterative/studio-support
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
iterative/studio-support#102 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
iterative/studio-support#97 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
iterative/studio-support#96 · 4 comments ·
-
feature request
Difficulty 4/5 3-5 days Newbie friendliness 35/100
iterative/studio-support#88 · 1 comment · 7 reactions ·
-
feature request
Difficulty 4/5 3-5 days Newbie friendliness 25/100
iterative/studio-support#81 · 15 comments · 2 reactions ·
All issues in iterative/studio-support
Similar issues
-
type/bug
Difficulty 1/5 Under an hour Newbie friendliness 86/100
h2oai/h2o-llmstudio#1163 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
srbhr/Resume-Matcher#1107 · 1 comment ·
Maintainers usually reply within 1 day
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.xPossibly taken @NimaVaziri claimed this today. OpenPytorch
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/TensorRT-LLM#23406 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
lakshaychhaba0001-sys/openbench-ai#230 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day