Plots a decision tree with matplotlib by using annotations.
This is the approach used by Peter Harrington in his book Machine
Learning in Action.
-
__init__(tree)[source]
Constructs a new plotter.
- Args:
- tree: Tree
- The decision tree to be plotted.
-
arrow_args = {'arrowstyle': '<-'}
-
decision_node_type = {'fc': '0.8', 'boxstyle': 'sawtooth'}
-
leaf_node_type = {'fc': '0.8', 'boxstyle': 'round4'}
-
plot()[source]
Generate a plot of the decision tree.
- Returns:
- void