Created
May 17, 2019 11:05
-
-
Save theSekyi/76f0c6219ebce883676672e76257e96a 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
| import os | |
| from PIL import Image | |
| path = '.' | |
| from IPython.display import Image | |
| from sklearn.tree import export_graphviz | |
| from matplotlib.pyplot import imshow | |
| def image_path(fig): | |
| return os.path.join(path,fig) | |
| export_graphviz( | |
| tree_classifier, | |
| out_file=image_path("wine.dot"), | |
| feature_names=list(df_x.drop('quality',axis=1)), | |
| class_names=['C', 'D', 'E', 'B', 'F', 'A'], | |
| rounded=True, | |
| filled=True | |
| ) | |
| !dot -Tpng wine.dot -o wine.png | |
| Image(filename='wine.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment