Created
October 26, 2019 02:18
-
-
Save carlleston/ced7d8d3f6d1e8a3d3ec4b8a2b3c4e75 to your computer and use it in GitHub Desktop.
This file contains 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 IPython.display import Image | |
from sklearn.tree import export_graphviz | |
import pydotplus | |
import os | |
os.environ['PATH'] = os.environ['PATH']+';'+os.environ['CONDA_PREFIX']+r"\Library\bin\graphviz" | |
dot_data = StringIO() | |
export_graphviz(pipe.named_steps['regressor'].estimators_[0], out_file=dot_data) | |
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