10000 MAINT Mark for removal deprecated LinearSVC loss options in 0.23 (#14… · scikit-learn/scikit-learn@b0fdc4c · GitHub
[go: up one dir, main page]

Skip to content

Commit b0fdc4c

Browse files
rthqinhanmin2014
authored andcommitted
MAINT Mark for removal deprecated LinearSVC loss options in 0.23 (#14373)
1 parent c0c5313 commit b0fdc4c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

sklearn/svm/classes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,15 @@ def fit(self, X, y, sample_weight=None):
210210
-------
211211
self : object
212212
"""
213-
# FIXME Remove l1/l2 support in 1.0 -----------------------------------
213+
# FIXME Remove l1/l2 support in 0.23 ----------------------------------
214214
msg = ("loss='%s' has been deprecated in favor of "
215215
"loss='%s' as of 0.16. Backward compatibility"
216216
" for the loss='%s' will be removed in %s")
217217

218218
if self.loss in ('l1', 'l2'):
219219
old_loss = self.loss
220220
self.loss = {'l1': 'hinge', 'l2': 'squared_hinge'}.get(self.loss)
221-
warnings.warn(msg % (old_loss, self.loss, old_loss, '1.0'),
221+
warnings.warn(msg % (old_loss, self.loss, old_loss, '0.23'),
222222
DeprecationWarning)
223223
# ---------------------------------------------------------------------
224224

@@ -397,7 +397,7 @@ def fit(self, X, y, sample_weight=None):
397397
-------
398398
self : object
399399
"""
400-
# FIXME Remove l1/l2 support in 1.0 -----------------------------------
400+
# FIXME Remove l1/l2 support in 0.23 ----------------------------------
401401
msg = ("loss='%s' has been deprecated in favor of "
402402
"loss='%s' as of 0.16. Backward compatibility"
403403
" for the loss='%s' will be removed in %s")
@@ -407,7 +407,7 @@ def fit(self, X, y, sample_weight=None):
407407
self.loss = {'l1': 'epsilon_insensitive',
408408
'l2': 'squared_epsilon_insensitive'
409409
}.get(self.loss)
410-
warnings.warn(msg % (old_loss, self.loss, old_loss, '1.0'),
410+
warnings.warn(msg % (old_loss, self.loss, old_loss, '0.23'),
411411
DeprecationWarning)
412412
# ---------------------------------------------------------------------
413413

sklearn/svm/tests/test_svm.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ def test_linearsvc_parameters():
577577
svm.LinearSVC(loss="l3").fit, X, y)
578578

579579

580-
# FIXME remove in 1.0
580+
# FIXME remove in 0.23
581581
def test_linearsvx_loss_penalty_deprecations():
582582
X, y = [[0.0], [1.0]], [0, 1]
583583

@@ -588,25 +588,25 @@ def test_linearsvx_loss_penalty_deprecations():
588588
# LinearSVC
589589
# loss l1 --> hinge
590590
assert_warns_message(DeprecationWarning,
591-
msg % ("l1", "hinge", "loss='l1'", "1.0"),
591+
msg % ("l1", "hinge", "loss='l1'", "0.23"),
592592
svm.LinearSVC(loss="l1").fit, X, y)
593593

594594
# loss l2 --> squared_hinge
595595
assert_warns_message(DeprecationWarning,
596-
msg % ("l2", "squared_hinge", "loss='l2'", "1.0"),
596+
msg % ("l2", "squared_hinge", "loss='l2'", "0.23"),
597597
svm.LinearSVC(loss="l2").fit, X, y)
598598

599599
# LinearSVR
600600
# loss l1 --> epsilon_insensitive
601601
assert_warns_message(DeprecationWarning,
602602
msg % ("l1", "epsilon_insensitive", "loss='l1'",
603-
"1.0"),
603+
"0.23"),
604604
svm.LinearSVR(loss="l1").fit, X, y)
6056 661C 05

606606
# loss l2 --> squared_epsilon_insensitive
607607
assert_warns_message(DeprecationWarning,
608608
msg % ("l2", "squared_epsilon_insensitive",
609-
"loss='l2'", "1.0"),
609+
"loss='l2'", "0.23"),
610610
svm.LinearSVR(loss="l2").fit, X, y)
611611

612612

0 commit comments

Comments
 (0)
0