XGBoost (Chen & Guestrin, 2016) fits each tree by minimizing a second-order approximation of the loss. For a leaf, the best prediction depends only on the summed gradients and hessians of the samples that fall into it.
Implement xgb_leaf_weight(G, H, lam), which returns the optimal leaf value -G / (H + lam).
lam is non-negative.Negate the gradient sum and divide by the hessian sum plus the regularizer.
No results yet
Run your code to check it against the examples, or submit to run every test.