输出svg时中文显示正常!!! from six import StringIO #可视化 dot_data = StringIO() tree.export_graphviz(clf,out_file = dot_data,feature_names=feature_name, class_names=target_name,filled=True,rounded=True, special_characters=True) graph = pydotplus.graph_from_dot_data(dot_data.getvalue()) graph.write_svg("Tree.svg")
参考:(67条消息) 亲测!决策树可视化Graphviz中文乱码问题~_graphviz可视化改为字_数据社的博客-CSDN博客
标签:graph,Graphviz,乱码,True,可视化,data,dot,决策树 From: https://www.cnblogs.com/cupleo/p/17309801.html