tree_plotting Module

Plots decision trees.

@author: drusk

class pml.supervised.decision_trees.tree_plotting.MatplotlibAnnotationTreePlotter(tree)[source]

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

Project Versions

Previous topic

plotting Module

Next topic

trees Module

This Page