Lv.的博客

决策树可视化

 

 

 

 

 

 

 

案例:

 

from sklearn import tree
from IPython.display import Image
import pydotplus
dot_data = tree.export_graphviz(model, out_file=None, filled=True, rounded=True, special_characters=True)

graph = pydotplus.graph_from_dot_data(dot_data)
graph.write_pdf('iris.pdf')
Image(graph.create_png())
posted @ 2019-08-19 15:23  Avatarx  阅读(695)  评论(2编辑  收藏  举报