linkedin / linkedin/FastTreeSHAP

The notebook example is not working

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

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

主要言語
Python
スター
566
フォーク
38
PR マージ指標
30日以内にマージされた PR はありません

説明

I tried to run the notebook example with the following code snippet:

shap_explainer = fasttreeshap.TreeExplainer(lgb_model)
num_leaves = sum(shap_explainer.model.num_nodes) - sum(sum(shap_explainer.model.children_left > 0))
print("Total number of leaves is {}.".format(num_leaves))

But got the error:

AttributeError                            Traceback (most recent call last)
<command-4123838717328114> in <cell line: 2>()
      1 shap_explainer = fasttreeshap.TreeExplainer(lgb_model)
----> 2 num_leaves = sum(shap_explainer.model.num_nodes) - sum(sum(shap_explainer.model.children_left > 0))
      3 print("Total number of leaves is {}.".format(num_leaves))

AttributeError: 'TreeEnsemble' object has no attribute 'num_nodes'

The lightbgm library version is '3.3.5'. Maybe you want to update the notebook correspondingly.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

示された TreeExplainer と num_leaves のスニペットを含む notebook の例を特定し、LightGBM 3.3.5 で AttributeError を再現してください。そのバージョンで実行できるように例を更新し、notebook が完了して葉の総数を報告することを確認してください。

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

評価

技術スタック
python
領域
machine-learning
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

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

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