graphviz
1、生成dot文件
from sklearn.tree import export_graphviz
export_graphviz(
tree_clf,
out_file=”./iris_tree.dot”,
feature_names=iris.feature_names[:],
class_names=iris.target_names,
rounded=True,
filled=True
)
2、用graphviz生成图片
.\dot -Tpng D:\PythonProject\AI_Study\decision_tree\iris_tree.dot -o D:\PythonProject\AI_Study\decision_tree\iris_tree.png
版权声明:本文为qq_45336930原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。