决策树中的graphvizm pydotplus问题

puzhinan7781 2018-04-26 08:00:04
决策树Python 3.5程序
from IPython.display import Image
from sklearn import tree
import pydotplus
from pydotplus import graphviz
dot_data = tree.export_graphviz(clf, out_file=None,
feature_names=iris.feature_names,
class_names=iris.target_names,
filled=True, rounded=True,
special_characters=True)
graph = pydotplus.graphviz.graph_from_dot_data(dot_data)

Image(graph.create_png())

运行出现“AttributeError: 'NoneType' object has no attribute 'write'”
...全文
1292 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧