bartz.grove.is_actual_leaf

bartz.grove.is_actual_leaf(split_tree, *, add_bottom_level=False)[source]

Return a mask indicating the leaf nodes in a tree.

Parameters:
  • split_tree (UInt[Array, 'half_tree_size']) – The splitting points of the tree.

  • add_bottom_level (bool, default: False) – If True, the bottom level of the tree is also considered.

Returns:

Bool[Array, 'half_tree_size'] | Bool[Array, '2*half_tree_size'] – The mask marking the leaf nodes. Length doubled if add_bottom_level is True.