
XGBoost regularized split gain (Geron Ch 7, morie.fn grxgbg)
Source:R/geron_train_native.R
morie_geron_xgboost_gain.RdGain = 0.5 [GL^2/(HL+l) + GR^2/(HR+l) - G^2/(H+l)] - gamma; a negative gain means prune.
Value
List with gain, left_score, right_score,
parent_score, left_weight, right_weight, should_split.
Examples
morie_geron_xgboost_gain(3, 2, -1, 1.5, lam = 1, gamma = 0.2)
#> $gain
#> [1] 1.055556
#>
#> $left_score
#> [1] 3
#>
#> $right_score
#> [1] 0.4
#>
#> $parent_score
#> [1] 0.8888889
#>
#> $left_weight
#> [1] -1
#>
#> $right_weight
#> [1] 0.4
#>
#> $should_split
#> [1] TRUE
#>
#> $estimate
#> [1] 1.055556
#>
#> $n
#> [1] 2
#>