Tree Utilities
Tree parsing utilities and lightweight tree data structures.
- class Node(node_id, *, feature=None, value=None, parent=None, threshold=None, code=None, n_samples=0, left=None, right=None)[source]
Bases:
NodeMixinNode in a parsed decision tree.
- property code
- property feature
- property left
- property length
- property n_samples
- property node_id
- property right
- property sigma
- property threshold
- property value
- class Tree(root)[source]
Bases:
objectIn-memory representation of a parsed tree ensemble member.
- property adaboost
- property leaves
- property logit
- property max_depth
- property n_nodes
- property shape
- property xgboost
- root
- parse_ensembles(*ensembles, mapper)[source]
Flatten and parse one or more supported tree ensembles.
- Returns:
Parsed trees from every provided ensemble, flattened into one tuple.
- Return type:
tuple[Tree, …]