Attend the Women in ML Symposium on December 7 Register now

tfdf.py_tree.tree.Tree

Stay organized with collections Save and categorize content based on your preferences.

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.