In Jupyter displaying the DT is done as follows:
# Display in jupyter notebook from IPython.display import Image Image(filename = 'tree.png')
How to see DT in anaconda?
Data Science Stack Exchange is a question and answer site for Data science professionals, Machine Learning specialists, and those interested in learning more about the field. It only takes a minute to sign up.Sign up to join this community
there is a simpler way but sometimes it doesn't work first, you should call your method like this
then you can choose a name and path for it, let others remain the same as I did so overall, it would look like:
from sklearn.tree import export_graphviz export_graphviz( tree_clf, out_file=image_path("iris_tree.dot"), feature_names=iris.feature_names[2:], class_names=iris.target_names, rounded=True, filled=True )
hope it works for you