Eri*_*rin 6 python visualization decision-tree random-forest scikit-learn
在 中[R],您可以像这样可视化随机森林的结果(图像无耻地从互联网上窃取)。Python 中的等价物是什么?我可以使用 获得 sklearn 随机森林分类的结果feature_importances_,但我想知道他们将结果发送到哪个方向。我意识到在森林深处我无法检查每个分支,但也许它可以权衡概率?谢谢。

使用tree.export_graphviz的参数,请参阅此示例和图像结果:
tree.export_graphviz(clf, out_file=out, feature_names=['alcohol', 'income'],class_names=['0','1'],
filled=True, rounded=True, special_characters=True)
graph=pydotplus.graph_from_dot_data(out.getvalue())
Image(graph.create_png())
Run Code Online (Sandbox Code Playgroud)
图像结果
请参阅github 上的 jupyter 笔记本和项目详细信息。
| 归档时间: |
|
| 查看次数: |
5495 次 |
| 最近记录: |