tfdf.py_tree.tree.Tree

A single decision tree.

label_classes

root

Methods

pretty

View source

Returns a readable textual representation of the tree.

Unlike repr(tree), tree.pretty() format the representation (line return, margin, hide class names) to improve readability.

This representation can be changed and codes should not try to parse the output of pretty. To access programmatically the tree structure, use root().

Args
max_depth The maximum depth of the nodes to display. Deeper nodes are skipped and replaced by "...". If not specified, prints the entire tree.

Returns
A pretty-string representing the tree.