Hello,

I'm trying the Python Decision tree example code from this website:
https://medium.com/@rnbrown/creating-and-visualizing-decision-trees-with-python-f8e8fa394176

All lines execute without any problems except the very last one to produce 
the image. When I run it I get the following error message:


*InvocationException: GraphViz's executables not found*

I'm pasting the full code below. 

Thanks


*import sklearn.datasets as datasets*
*import pandas as pd*
*iris=datasets.load_iris()*
*df=pd.DataFrame(iris.data, columns=iris.feature_names)*
*y=iris.target*


*from sklearn.tree import DecisionTreeClassifier*
*dtree=DecisionTreeClassifier()*
*dtree.fit(df,y)*


*from sklearn.externals.six import StringIO  *
*from IPython.display import Image  *
*from sklearn.tree import export_graphviz*
*import pydotplus*
*dot_data = StringIO()*
*export_graphviz(dtree, out_file=dot_data,  *
*                filled=True, rounded=True,*
*                special_characters=True)*
*graph = pydotplus.graph_from_dot_data(dot_data.getvalue())  *
*Image(graph.create_png())   *


-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to spyderlib+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/spyderlib/8090401d-b78b-47c3-85e5-98812a0e33b8%40googlegroups.com.

Reply via email to