The notebook example is not working
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- python
调研方向
找到包含所示 TreeExplainer 和 num_leaves 代码片段的 notebook 示例,然后使用 LightGBM 3.3.5 重现 AttributeError。更新该示例,使其能够在该版本下运行,并验证 notebook 能够完成,同时报告叶子的总数。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Python
- 星标
- 566
- 派生
- 38
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
linkedin/FastTreeSHAP 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
linkedin/FastTreeSHAP#37 ·
-
难度 2/5 1-3 小时 新手友好度 48/100
linkedin/FastTreeSHAP#36 ·
-
难度 3/5 1-2 天 新手友好度 35/100
linkedin/FastTreeSHAP#35 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
linkedin/FastTreeSHAP#34 ·
-
难度 3/5 1-2 天 新手友好度 30/100
linkedin/FastTreeSHAP#33 · 2 条评论 ·
查看 linkedin/FastTreeSHAP 的全部 Issue
相似的 Issue
-
agent-ready documentation needs-triage
难度 1/5 1-3 小时 新手友好度 88/100
-
documentation
难度 1/5 1 小时以内 新手友好度 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" 未关闭
难度 1/5 1 小时以内 新手友好度 92/100
-
instance instance add
难度 1/5 1 小时以内 新手友好度 72/100
searxng/searx-instances#939 · 1 条评论 ·
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100