I installed pydotplus and graphviz in an virtual environment (Windows 8.1). Now I want to visualize a decision tree. However pydotplus is not able to find GraphViz's executables.
from sklearn import tree
from sklearn.datasets import load_iris
import pydotplus
from IPython.display import Image
iris = load_iris()
X,y = iris.data[:,2:], iris.target
clf = tree.DecisionTreeClassifier(max_depth=2)
clf.fit(X,y)
dot_data = tree.export_graphviz(clf,
out_file=None,
feature_names=iris.feature_names[2:],
class_names=iris.target_names,
rounded=True,
filled=True)
graph = pydotplus.graph_from_dot_data(dot_data)
Image(graph.create_png())
People solved this problem by adding the GraphViz bin directory their PATH. Apparently this directory usually is C:\Program Files (x86)\Graphviz2.34\bin\
. However it is not in my case. How can I find it?