Skip to main content

Module globals

Module globals 

Source
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.