I am able to generate a decision tree plot using graphviz, but when I try to save it (i.e., out_file)
I get the following error:
CalledProcessError: Command '['dot', '-Tsvg']' returned non-zero exit status 1.
Here is my code:
# create plot for decision tree
dot_data = tree.export_graphviz(model,
out_file='tree.dot', # this is what triggers the error
feature_names=X_test.columns,
class_names=['Active','Churned'])
graph = graphviz.Source(dot_data)
# view plot
graph
The out_file
argument is the one that triggers the error. I'm thinking that this should be a pretty easy solution, but I have not found an answer from my searches.
Thank you in advance.