Add Decision Tree and Model draw methods to visualise tree structure showing:
feature and threshold for non-leaves
score/value for leaves
The plotting uses Graphviz and pydot for drawing, which are not added to the dependencies, but will not break import if not available, and print a helpful message if drawing is attempted without them.
Here's an example for one tree (e.g. conifer_model.trees[0][0].draw(filename='tree.png')):
and here's an example for a model (e.g. conifer_model.draw(filename='model.png')):
Add Decision Tree and Model
draw
methods to visualise tree structure showing:The plotting uses Graphviz and
pydot
for drawing, which are not added to the dependencies, but will not break import if not available, and print a helpful message if drawing is attempted without them.Here's an example for one tree (e.g.
conifer_model.trees[0][0].draw(filename='tree.png')
):and here's an example for a model (e.g.
conifer_model.draw(filename='model.png')
):