lightgbm.create_tree_digraph — LightGBM 4.6.0.99 documentation (original) (raw)

LightGBM

lightgbm.create_tree_digraph(booster, tree_index=0, show_info=None, precision=3, orientation='horizontal', example_case=None, max_category_values=10, **kwargs)[source]

Create a digraph representation of specified tree.

Each node in the graph represents a node in the tree.

Non-leaf nodes have labels like Column_10 <= 875.9, which means “this node splits on the feature named “Column_10”, with threshold 875.9”.

Leaf nodes have labels like leaf 2: 0.422, which means “this node is a leaf node, and the predicted value for records that fall into this node is 0.422”. The number (2) is an internal unique identifier and doesn’t have any special meaning.

Parameters:

Returns:

graph – The digraph representation of specified tree.

Return type:

graphviz.Digraph