@@ -361,6 +361,7 @@ def __init__(
361
361
reg_alpha ,
362
362
reg_lambda ,
363
363
max_delta_step ,
364
+ gain_scale ,
364
365
min_cat_samples ,
365
366
cat_smooth ,
366
367
missing ,
@@ -411,6 +412,7 @@ def __init__(
411
412
self .reg_alpha = reg_alpha
412
413
self .reg_lambda = reg_lambda
413
414
self .max_delta_step = max_delta_step
415
+ self .gain_scale = gain_scale
414
416
self .min_cat_samples = min_cat_samples
415
417
self .cat_smooth = cat_smooth
416
418
self .missing = missing
@@ -942,6 +944,7 @@ def fit(self, X, y, sample_weight=None, bags=None, init_score=None):
942
944
reg_alpha = 0.0
943
945
reg_lambda = 0.0
944
946
max_delta_step = 0.0
947
+ gain_scale = 1.0
945
948
min_cat_samples = 0
946
949
cat_smooth = 0.0
947
950
missing = "low"
@@ -965,6 +968,7 @@ def fit(self, X, y, sample_weight=None, bags=None, init_score=None):
965
968
reg_alpha = self .reg_alpha
966
969
reg_lambda = self .reg_lambda
967
970
max_delta_step = self .max_delta_step
971
+ gain_scale = self .gain_scale
968
972
min_cat_samples = self .min_cat_samples
969
973
cat_smooth = self .cat_smooth
970
974
missing = self .missing
@@ -1084,6 +1088,7 @@ def fit(self, X, y, sample_weight=None, bags=None, init_score=None):
1084
1088
reg_alpha ,
1085
1089
reg_lambda ,
1086
1090
max_delta_step ,
1091
+ gain_scale ,
1087
1092
min_cat_samples ,
1088
1093
cat_smooth ,
1089
1094
missing ,
@@ -1359,6 +1364,7 @@ def fit(self, X, y, sample_weight=None, bags=None, init_score=None):
1359
1364
reg_alpha ,
1360
1365
reg_lambda ,
1361
1366
max_delta_step ,
1367
+ gain_scale ,
1362
1368
min_cat_samples ,
1363
1369
cat_smooth ,
1364
1370
missing ,
@@ -1486,6 +1492,7 @@ def fit(self, X, y, sample_weight=None, bags=None, init_score=None):
1486
1492
0.0 ,
1487
1493
0.0 ,
1488
1494
0.0 ,
1495
+ 1.0 ,
1489
1496
min_cat_samples ,
1490
1497
cat_smooth ,
1491
1498
missing ,
@@ -2785,6 +2792,9 @@ class ExplainableBoostingClassifier(ClassifierMixin, EBMModel):
2785
2792
L2 regularization.
2786
2793
max_delta_step : float, default=0.0
2787
2794
Used to limit the max output of tree leaves. <=0.0 means no constraint.
2795
+ gain_scale : float, default=1.0
2796
+ Scale factor to apply to nominal categoricals. A scale factor above 1.0 will cause the
2797
+ algorithm focus more on the nominal categoricals.
2788
2798
min_cat_samples : int, default=10
2789
2799
Minimum number of samples in order to treat a category separately. If lower than this threshold
2790
2800
the category is combined with other categories that have low numbers of samples.
@@ -2964,6 +2974,7 @@ def __init__(
2964
2974
reg_alpha : Optional [float ] = 0.0 ,
2965
2975
reg_lambda : Optional [float ] = 0.0 ,
2966
2976
max_delta_step : Optional [float ] = 0.0 ,
2977
+ gain_scale : Optional [float ] = 1.0 ,
2967
2978
min_cat_samples : Optional [int ] = 10 ,
2968
2979
cat_smooth : Optional [float ] = 10.0 ,
2969
2980
missing : str = "separate" ,
@@ -2997,6 +3008,7 @@ def __init__(
2997
3008
reg_alpha = reg_alpha ,
2998
3009
reg_lambda = reg_lambda ,
2999
3010
max_delta_step = max_delta_step ,
3011
+ gain_scale = gain_scale ,
3000
3012
min_cat_samples = min_cat_samples ,
3001
3013
cat_smooth = cat_smooth ,
3002
3014
missing = missing ,
@@ -3167,6 +3179,9 @@ class ExplainableBoostingRegressor(RegressorMixin, EBMModel):
3167
3179
L2 regularization.
3168
3180
max_delta_step : float, default=0.0
3169
3181
Used to limit the max output of tree leaves. <=0.0 means no constraint.
3182
+ gain_scale : float, default=1.0
3183
+ Scale factor to apply to nominal categoricals. A scale factor above 1.0 will cause the
3184
+ algorithm focus more on the nominal categoricals.
3170
3185
min_cat_samples : int, default=10
3171
3186
Minimum number of samples in order to treat a category separately. If lower than this threshold
3172
3187
the category is combined with other categories that have low numbers of samples.
@@ -3346,6 +3361,7 @@ def __init__(
3346
3361
reg_alpha : Optional [float ] = 0.0 ,
3347
3362
reg_lambda : Optional [float ] = 0.0 ,
3348
3363
max_delta_step : Optional [float ] = 0.0 ,
3364
+ gain_scale : Optional [float ] = 1.0 ,
3349
3365
min_cat_samples : Optional [int ] = 10 ,
3350
3366
cat_smooth : Optional [float ] = 10.0 ,
3351
3367
missing : str = "separate" ,
@@ -3379,6 +3395,7 @@ def __init__(
3379
3395
reg_alpha = reg_alpha ,
3380
3396
reg_lambda = reg_lambda ,
3381
3397
max_delta_step = max_delta_step ,
3398
+ gain_scale = gain_scale ,
3382
3399
min_cat_samples = min_cat_samples ,
3383
3400
cat_smooth = cat_smooth ,
3384
3401
missing = missing ,
@@ -3615,6 +3632,7 @@ def __init__(
3615
3632
reg_alpha = 0.0 ,
3616
3633
reg_lambda = 0.0 ,
3617
3634
max_delta_step = 0.0 ,
3635
+ gain_scale = 1.0 ,
3618
3636
min_cat_samples = 0 ,
3619
3637
cat_smooth = 0.0 ,
3620
3638
missing = None ,
@@ -3896,6 +3914,7 @@ def __init__(
3896
3914
reg_alpha = 0.0 ,
3897
3915
reg_lambda = 0.0 ,
3898
3916
max_delta_step = 0.0 ,
3917
+ gain_scale = 1.0 ,
3899
3918
min_cat_samples = 0 ,
3900
3919
cat_smooth = 0.0 ,
3901
3920
missing = None ,
0 commit comments