tabular_trees.BoosterString
- class tabular_trees.BoosterString(rows)[source]
Bases:
objectString version of a LightGBM Booster.
- __init__(rows)[source]
Initialise the BoosterString from a list of strings.
- Parameters:
rows (list[str]) – List of strings defining a Booster.
Methods
__init__(rows)Initialise the BoosterString from a list of strings.
Return all rows after the 'end of trees' line to the end.
Extract the header rows from BoosterString object.
extract_tree_rows(tree_number)Extract rows for given tree number.
from_booster(booster)Create BoosterString from a lgb.Booster object.
Convert the BoosterString back to a Booster.
Attributes
new_line- extract_bottom_rows()[source]
Return all rows after the ‘end of trees’ line to the end.
- Returns:
rows – Final rows from Booster text.
- Return type:
list[str]
- extract_header_rows()[source]
Extract the header rows from BoosterString object.
- Returns:
rows – Header rows from Booster text.
- Return type:
list[str]
- extract_tree_rows(tree_number)[source]
Extract rows for given tree number.
- Returns:
rows – Rows from Booster text for the given tree.
- Return type:
list[str]