I'm trying to display a decision tree in Jupyter Notebook and I keep receiving the message:
CalledProcessError: Command '['dot.bat', '-Tsvg']' returned non-zero exit status 1
I'm using the following code:
from sklearn.datasets import load_iris
from sklearn import tree
import graphviz
from IPython.display import SVG
iris = load_iris()
clf = tree.DecisionTreeClassifier()
fitted_clf = clf.fit(iris.data, iris.target)
graph = graphviz.Source(tree.export_graphviz(fitted_clf,
feature_names = iris.feature_names,
class_names = iris.target_names,
filled = True, rounded = True,
special_characters = True))
SVG(graph.pipe(format='svg'))
The Exception is raised in the last line when I try to use '