I'm on a Jupyter notebook using Python3 and trying to plot a tree with code like this:
import xgboost as xgb from xgboost import plot_tree plot_tree(model, num_trees=4)
On the last line I get:
~/anaconda3/envs/python3/lib/python3.6/site-packages/xgboost/plotting.py in to_graphviz(booster, fmap, num_trees, rankdir, yes_color, no_color, **kwargs) 196 from graphviz import Digraph 197 except ImportError: --> 198 raise ImportError('You must install graphviz to plot tree') 199 200 if not isinstance(booster, (Booster, XGBModel)): ImportError: You must install graphviz to plot tree
How do I install graphviz so I can see the plot_tree?