I have installed graphviz using the following command on my MacOS: brew install graphviz and now it shows that my graphviz is up-to-date.
However on running the following code on my Jupyter notebook:
# Extract the small tree
tree_small = regressor1.estimators_[5]
# Save the tree as a png image
export_graphviz(tree_small, out_file = 'tree.dot', feature_names = home_data.columns, rounded = True, precision = 1)
(graph, ) = pydot.graph_from_dot_file('tree.dot')
graph.write_png('tree.png')
Its throwing the following error:
FileNotFoundError: [Errno 2] "dot" not found in path. ExecutableNotFound: failed to execute 'dot', make sure the Graphviz executables are on your systems' PATH*
Would appreciate if someone could help me with the same. PS: I am new to using MacOS, so I am not sure how to work with adding the dot in the PATH. I tried doing echo $PATH, it certainly doesn't include graphviz, but not sure how to check where exactly it got installed.
Thanks