Expand description
Item encoding and small numeric helpers.
An item is a feature together with a branch: item 2 * f is the branch
where feature f is 0 (left), and item 2 * f + 1 the branch where it is
1 (right).
Functionsยง
- attribute
- The feature of an item.
- compute_
entropy - Shannon entropy (base 2) of a class distribution.
- float_
is_ null - Whether a value is zero, up to two units in the last place.
- get_
tree_ root_ error - The error of the root of
tree, infinite if the tree is empty. - get_
tree_ root_ gain - The metric stored at the root of
tree, 0 if none. - item
- The item of a feature and a branch.
- item_
type - The branch of an item: 0 for left, 1 for right.