XGBoost chooses splits by how much they reduce the regularized objective. The gain compares the score of the two children against the score of the parent, then subtracts a penalty for adding a leaf.
Implement xgb_split_gain(GL, HL, GR, HR, lam, gamma), returning the gain of a split minus gamma.
Compute each child's score G^2 / (H + lam), subtract the parent's score, halve the result, then subtract gamma.
No results yet
Run your code to check it against the examples, or submit to run every test.