tabular_trees.BoosterTree
- class tabular_trees.BoosterTree(tree, num_leaves, num_cat, split_feature, split_gain, threshold, decision_type, left_child, right_child, leaf_value, leaf_weight, leaf_count, internal_value, internal_weight, internal_count, is_linear, shrinkage)[source]
Bases:
objectData class for individual LightGBM trees.
- __init__(tree, num_leaves, num_cat, split_feature, split_gain, threshold, decision_type, left_child, right_child, leaf_value, leaf_weight, leaf_count, internal_value, internal_weight, internal_count, is_linear, shrinkage)
Methods
__init__(tree, num_leaves, num_cat, ...)Concatenate tree information to a single string.
Convert data to rows that could be concatenated to part of BoosterString.
Attributes
Tree index.
Number of leaves in tree.
num_catSplit feature indexes for internal nodes.
Split gain for internal nodes.
Split threshold for internal nodes.
2 for ordered splits.
Left child node indexes.
Right child node indexes.
Leaf predictions.
Sum of Hessian for rows in the leaf node.
Number of rows in the leaf node.
Prediction for internal nodes.
Sum of Hessian for rows in the internal node.
Number of rows in the internal node.
is_linearshrinkage- decision_type
2 for ordered splits.
- get_booster_sting()[source]
Concatenate tree information to a single string.
- Returns:
model – Booster as a string.
- Return type:
str
- get_booster_string_rows()[source]
Convert data to rows that could be concatenated to part of BoosterString.
- internal_count
Number of rows in the internal node.
- internal_value
Prediction for internal nodes.
- internal_weight
Sum of Hessian for rows in the internal node.
- leaf_count
Number of rows in the leaf node.
- leaf_value
Leaf predictions.
- leaf_weight
Sum of Hessian for rows in the leaf node.
- left_child
Left child node indexes.
Leaf nodes indexes are negative and indexed from -1.
- num_leaves
Number of leaves in tree.
- right_child
Right child node indexes.
Leaf nodes indexes are negative and indexed from -1.
- split_feature
Split feature indexes for internal nodes.
- split_gain
Split gain for internal nodes.
- threshold
Split threshold for internal nodes.
- tree
Tree index.