@@ -731,6 +731,15 @@ def _fit(
731
731
),
732
732
ConvergenceWarning ,
733
733
)
734
+
735
+ if self .power_t < 0 :
736
+ warnings .warn (
737
+ "Negative values for `power_t` are deprecated in version 1.8 "
738
+ "and will raise an error in 1.10. "
739
+ "Use values in the range [0.0, inf) instead." ,
740
+ FutureWarning ,
741
+ )
742
+
734
743
return self
735
744
736
745
def _fit_binary (self , X , y , alpha , C , sample_weight , learning_rate , max_iter ):
@@ -1082,7 +1091,11 @@ class SGDClassifier(BaseSGDClassifier):
1082
1091
1083
1092
power_t : float, default=0.5
1084
1093
The exponent for inverse scaling learning rate.
1085
- Values must be in the range `(-inf, inf)`.
1094
+ Values must be in the range `[0.0, inf)`.
1095
+
1096
+ .. deprecated:: 1.8
1097
+ Negative values for `power_t` are deprecated in version 1.8 and will raise
1098
+ an error in 1.10. Use values in the range [0.0, inf) instead.
1086
1099
1087
1100
early_stopping : bool, default=False
1088
1101
Whether to use early stopping to terminate training when validation
@@ -1585,6 +1598,14 @@ def _fit(
1585
1598
ConvergenceWarning ,
1586
1599
)
1587
1600
1601
+ if self .power_t < 0 :
1602
+ warnings .warn (
1603
+ "Negative values for `power_t` are deprecated in version 1.8 "
1604
+ "and will raise an error in 1.10. "
1605
+ "Use values in the range [0.0, inf) instead." ,
1606
+ FutureWarning ,
1607
+ )
1608
+
1588
1609
return self
1589
1610
1590
1611
@_fit_context (prefer_skip_nested_validation = True )
@@ -1880,7 +1901,11 @@ class SGDRegressor(BaseSGDRegressor):
1880
1901
1881
1902
power_t : float, default=0.25
1882
1903
The exponent for inverse scaling learning rate.
1883
- Values must be in the range `(-inf, inf)`.
1904
+ Values must be in the range `[0.0, inf)`.
1905
+
1906
+ .. deprecated:: 1.8
1907
+ Negative values for `power_t` are deprecated in version 1.8 and will raise
1908
+ an error in 1.10. Use values in the range [0.0, inf) instead.
1884
1909
1885
1910
early_stopping : bool, default=False
1886
1911
Whether to use early stopping to terminate training when validation
@@ -2118,7 +2143,11 @@ class SGDOneClassSVM(OutlierMixin, BaseSGD):
2118
2143
2119
2144
power_t : float, default=0.5
2120
2145
The exponent for inverse scaling learning rate.
2121
- Values must be in the range `(-inf, inf)`.
2146
+ Values must be in the range `[0.0, inf)`.
2147
+
2148
+ .. deprecated:: 1.8
2149
+ Negative values for `power_t` are deprecated in version 1.8 and will raise
2150
+ an error in 1.10. Use values in the range [0.0, inf) instead.
2122
2151
2123
2152
warm_start : bool, default=False
2124
2153
When set to True, reuse the solution of the previous call to fit as
@@ -2490,6 +2519,14 @@ def _fit(
2490
2519
ConvergenceWarning ,
2491
2520
)
2492
2521
2522
+ if self .power_t < 0 :
2523
+ warnings .warn (
2524
+ "Negative values for `power_t` are deprecated in version 1.8 "
2525
+ "and will raise an error in 1.10. "
2526
+ "Use values in the range [0.0, inf) instead." ,
2527
+ FutureWarning ,
2528
+ )
2529
+
2493
2530
return self
2494
2531
2495
2532
@_fit_context (prefer_skip_nested_validation = True )
0 commit comments