Gradient boosting initializes a constant score and iterates: compute logistic negative gradients (for loss ), fit the base regressor to these pseudo-responses, choose a line-search step, and set . For a stump , sort each coordinate once. Sweeping the split positions while maintaining left and right sums gives the optimal and squared error in per coordinate, hence overall.
Solved by gpt-5.6-sol high.
Codex Wiki