@@ -80,21 +80,12 @@ class BaseSGD(SparseCoefMixin, BaseEstimator, metaclass=ABCMeta):
80
80
"""Base class for SGD classification and regression."""
81
81
82
82
_parameter_constraints : dict = {
83
- "penalty" : [StrOptions ({"l2" , "l1" , "elasticnet" }), None ],
84
- "alpha" : [Interval (Real , 0 , None , closed = "left" )],
85
- "C" : [Interval (Real , 0 , None , closed = "right" )],
86
- "l1_ratio" : [Interval (Real , 0 , 1 , closed = "both" )],
87
83
"fit_intercept" : ["boolean" ],
88
84
"max_iter" : [Interval (Integral , 1 , None , closed = "left" )],
89
85
"tol" : [Interval (Real , 0 , None , closed = "left" ), None ],
90
86
"shuffle" : ["boolean" ],
91
- "random_state" : ["random_state" ],
92
87
"verbose" : ["verbose" ],
93
- "eta0" : [Interval (Real , 0 , None , closed = "left" )],
94
- "power_t" : [Interval (Real , None , None , closed = "neither" )],
95
- "early_stopping" : ["boolean" ],
96
- "validation_fraction" : [Interval (Real , 0 , 1 , closed = "neither" )],
97
- "n_iter_no_change" : [Interval (Integral , 1 , None , closed = "left" )],
88
+ "random_state" : ["random_state" ],
98
89
"warm_start" : ["boolean" ],
99
90
"average" : [Interval (Integral , 0 , None , closed = "left" ), "boolean" ],
100
91
}
@@ -523,6 +514,9 @@ class BaseSGDClassifier(LinearClassifierMixin, BaseSGD, metaclass=ABCMeta):
523
514
_parameter_constraints : dict = {
524
515
** BaseSGD ._parameter_constraints ,
525
516
"loss" : [StrOptions (set (loss_functions ))],
517
+ "early_stopping" : ["boolean" ],
518
+ "validation_fraction" : [Interval (Real , 0 , 1 , closed = "neither" )],
519
+ "n_iter_no_change" : [Interval (Integral , 1 , None , closed = "left" )],
526
520
"n_jobs" : [Integral , None ],
527
521
"class_weight" : [StrOptions ({"balanced" }), dict , None ],
528
522
}
@@ -1214,11 +1208,16 @@ class SGDClassifier(BaseSGDClassifier):
1214
1208
1215
1209
_parameter_constraints : dict = {
1216
1210
** BaseSGDClassifier ._parameter_constraints ,
1211
+ "penalty" : [StrOptions ({"l2" , "l1" , "elasticnet" }), None ],
1212
+ "alpha" : [Interval (Real , 0 , None , closed = "left" )],
1213
+ "l1_ratio" : [Interval (Real , 0 , 1 , closed = "both" )],
1214
+ "power_t" : [Interval (Real , None , None , closed = "neither" )],
1217
1215
"epsilon" : [Interval (Real , 0 , None , closed = "left" )],
1218
1216
"learning_rate" : [
1219
1217
StrOptions ({"constant" , "optimal" , "invscaling" , "adaptive" }),
1220
1218
Hidden (StrOptions ({"pa1" , "pa2" })),
1221
1219
],
1220
+ "eta0" : [Interval (Real , 0 , None , closed = "left" )],
1222
1221
}
1223
1222
1224
1223
def __init__ (
@@ -1405,6 +1404,9 @@ class BaseSGDRegressor(RegressorMixin, BaseSGD):
1405
1404
_parameter_constraints : dict = {
1406
1405
** BaseSGD ._parameter_constraints ,
1407
1406
"loss" : [StrOptions (set (loss_functions ))],
1407
+ "early_stopping" : ["boolean" ],
1408
+ "validation_fraction" : [Interval (Real , 0 , 1 , closed = "neither" )],
1409
+ "n_iter_no_change" : [Interval (Integral , 1 , None , closed = "left" )],
1408
1410
}
1409
1411
1410
1412
@abstractmethod
@@ -2014,11 +2016,16 @@ class SGDRegressor(BaseSGDRegressor):
2014
2016
2015
2017
_parameter_constraints : dict = {
2016
2018
** BaseSGDRegressor ._parameter_constraints ,
2019
+ "penalty" : [StrOptions ({"l2" , "l1" , "elasticnet" }), None ],
2020
+ "alpha" : [Interval (Real , 0 , None , closed = "left" )],
2021
+ "l1_ratio" : [Interval (Real , 0 , 1 , closed = "both" )],
2022
+ "power_t" : [Interval (Real , None , None , closed = "neither" )],
2017
2023
"learning_rate" : [
2018
2024
StrOptions ({"constant" , "optimal" , "invscaling" , "adaptive" }),
2019
2025
Hidden (StrOptions ({"pa1" , "pa2" })),
2020
2026
],
2021
2027
"epsilon" : [Interval (Real , 0 , None , closed = "left" )],
2028
+ "eta0" : [Interval (Real , 0 , None , closed = "left" )],
2022
2029
}
2023
2030
2024
2031
def __init__ (
@@ -2228,6 +2235,8 @@ class SGDOneClassSVM(BaseSGD, OutlierMixin):
2228
2235
StrOptions ({"constant" , "optimal" , "invscaling" , "adaptive" }),
2229
2236
Hidden (StrOptions ({"pa1" , "pa2" })),
2230
2237
],
2238
+ "eta0" : [Interval (Real , 0 , None , closed = "left" )],
2239
+ "power_t" : [Interval (Real , None , None , closed = "neither" )],
2231
2240
}
2232
2241
2233
2242
def __init__ (
0 commit comments