


案例:

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())
决策树可视化
原文:https://www.cnblogs.com/lvdongjie/p/11377335.html