Created
September 10, 2018 15:07
-
-
Save emmagrimaldi/e6fd6d1e7c532cab466cd978a2bc9224 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sklearn.externals.six import StringIO | |
| from sklearn.tree import export_graphviz | |
| import pydotplus | |
| from IPython.display import Image | |
| dot_data = StringIO() | |
| export_graphviz( | |
| model, | |
| out_file = dot_data, | |
| filled=True, rounded=True, proportion=False, | |
| special_characters=True, | |
| feature_names=X.columns, | |
| class_names=["cat", "dog"] | |
| ) | |
| graph = pydotplus.graph_from_dot_data(dot_data.getvalue()) | |
| Image(graph.create_png()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment