I'm attempting to use GraphViz to visualize a decision tree with Google Cloud Datalab, but the following error is being thrown:
InvocationException: GraphViz's executables not found
I found a related post, but the solutions here did not resolve the problem in Datalab.
Run the following to replicate:
!pip install graphviz
import graphviz
import numpy as np
from sklearn.datasets import load_iris
from sklearn import tree
from sklearn.externals.six import StringIO
iris = load_iris()
train_data = iris.data
train_labels = iris.target
clf = tree.DecisionTreeClassifier()
clf.fit(train_data, train_labels)
dot_data = tree.export_graphviz(clf, out_file=None,
feature_names=iris.feature_names,
class_names=iris.target_names)
graph = graphviz.Source(dot_data)
graph