You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

请问与生成的决策树相邻的实心黑色矩形是什么?

问题解答

那个和决策树相邻的实心黑色矩形是可视化渲染时的小瑕疵,没有任何实际业务或模型相关的含义。

出现这个问题的原因是pydotplus在将dot格式数据转换为图片时的渲染bug,和你的决策树模型本身没有关系。你可以尝试以下几种方式解决:

  • 升级pydotplus到最新版本
  • 替换可视化工具,比如使用graphviz直接生成图片,或者改用sklearn的plot_tree方法(更简洁且不易出现这类渲染问题)

举个用plot_tree替代的示例代码:

from sklearn.tree import plot_tree
import matplotlib.pyplot as plt

plt.figure(figsize=(12,8))
plot_tree(dtree, filled=True, rounded=True, feature_names=iris.feature_names, class_names=iris.target_names)
plt.show()

内容的提问来源于stack exchange,提问作者nicomp

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.27 19:32:46