Webgraphviz输出不包围决策树的页面

问题描述 投票:0回答:1

我需要生成的完整树的图像,但它没有环绕,也没有下载或保存图像选项。唯一剩下的选择是截取不捕获整个树的屏幕截图。

我如何获得整棵树?

我在Spyder中使用这种方法生成了一棵树

#Displaying the decision tree
from sklearn import tree
#from StringIO import StringIO
from io import StringIO
#from StringIO import StringIO 
with open("classifier.txt", "w") as f:
 f = tree.export_graphviz(classifier, out_file=f)

这会生成一个文件classifier.text,当复制并粘贴到qazxsw poi时会生成一个决策树

http://webgraphviz.com/

快照已缩小到最大可能范围。

python plot tree
1个回答
0
投票

好吧所以我通过做一些广泛的谷歌搜索修复了解决方案,现在我可以将它保存为png。

Displaying the decision tree

Here is the image of the output
© www.soinside.com 2019 - 2024. All rights reserved.