Skip to main content

leaf_weight

Function leaf_weight 

Source
pub fn leaf_weight(grad_sum: f64, hess_sum: f64, lambda: f64) -> f64
Available on crate feature alloc only.
Expand description

Compute the optimal leaf weight: -G / (H + lambda).

This is the closed-form solution for the leaf value that minimizes the regularized second-order Taylor expansion of the loss.