Skip to content

Instantly share code, notes, and snippets.

@marthall
Last active May 22, 2016 14:21
Show Gist options
  • Save marthall/0fa9de346856e8124021b27288eae2c9 to your computer and use it in GitHub Desktop.
Save marthall/0fa9de346856e8124021b27288eae2c9 to your computer and use it in GitHub Desktop.
Forest export to graphics
from sklearn.tree import export_graphviz
out = export_graphviz(forest.estimators_[0], out_file='tree.dot')
# From terminal:
# dot -Tpng tree.dot -o tree.png
# http://scikit-learn.org/stable/modules/generated/sklearn.tree.export_graphviz.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment