sklearn.tree.export_graphviz()

sklearn.tree.export_graphviz

sklearn.tree.export_graphviz() [source]

Export a decision tree in DOT format.

This function generates a GraphViz representation of the decision tree, which is then written into out_file. Once exported, graphical renderings can be generated using, for example:

$ dot -Tps tree.dot -o tree.ps      (PostScript format)
$ dot -Tpng tree.dot -o tree.png    (PNG format)

The sample counts that are shown are weighted with any sample_weights that might be present.

Read more in the 登录查看完整内容