决策树可视化
时间:2019-08-19 15:56:10
收藏:0
阅读:80
案例:
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)
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())
原文:https://www.cnblogs.com/lvdongjie/p/11377335.html
评论(0)