bartz.grove.forest_mean_leaves

bartz.grove.forest_mean_leaves(split_tree, *, where=None)[source]

Return the average number of leaves per tree in a set of trees.

Parameters:
  • split_tree (UInt[Array, '*batch_shape max_num_leaves']) – The decision boundaries of the trees.

  • where (Bool[Array, '*batch_shape'] | None, default: None) – Which trees to average over, all if None.

Returns:

Float32[Array, ''] – The mean number of leaves across the trees, NaN if there are no trees.