Add support for shap interactive plots

オープン
#82 コメント 3 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python

調査の方向性

まず、dvc_plots/index.htmlがどのように作成され、Studioがplotをどのように読み込むかを追跡します。このissueでは実装ファイルが指定されていません。SHAPのshap.getjs()とplotのHTML出力を確認し、続いて両方をどのように埋め込めるかを判断し、インタラクティブなplotがStudioでレンダリングされることを検証します。

索引モデルが issue の本文から書いたものです。

説明

feature request

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()
主要言語
言語のデータがありません
スター
17
フォーク
1
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

iterative/studio-support のほかの issue

iterative/studio-support の issue をすべて見る

似ている issue

Machine Learning の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。