Skip to content

Commit 85e01c9

Browse files
authored
Merge pull request #7200 from janezd/lr-remove-deprecated-multi-class
Logistic regression: Remove deprecated argument multi_class
2 parents d936532 + fc6bdfe commit 85e01c9

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

Orange/classification/logistic_regression.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
import warnings
2-
31
import numpy as np
42
import sklearn.linear_model as skl_linear_model
53

64
from Orange.classification import SklLearner, SklModel
75
from Orange.preprocess import Normalize
86
from Orange.preprocess.score import LearnerScorer
97
from Orange.data import Variable, DiscreteVariable
10-
from Orange.util import OrangeDeprecationWarning
118

129

1310
__all__ = ["LogisticRegressionLearner"]
@@ -42,23 +39,13 @@ class LogisticRegressionLearner(SklLearner, _FeatureScorerMixin):
4239
def __init__(self, penalty="l2", dual=False, tol=0.0001, C=1.0,
4340
fit_intercept=True, intercept_scaling=1, class_weight=None,
4441
random_state=None, solver="auto", max_iter=100,
45-
multi_class="deprecated", verbose=0, n_jobs=1, preprocessors=None):
46-
if multi_class != "deprecated":
47-
warnings.warn("The multi_class parameter was "
48-
"deprecated in scikit-learn 1.5. Using it with "
49-
"scikit-learn 1.7 will lead to a crash.",
50-
OrangeDeprecationWarning,
51-
stacklevel=2)
42+
verbose=0, n_jobs=1, preprocessors=None):
5243
super().__init__(preprocessors=preprocessors)
5344
self.params = vars()
5445

5546
def _initialize_wrapped(self):
5647
params = self.params.copy()
5748

58-
multi_class = params.pop("multi_class")
59-
if multi_class != "deprecated":
60-
params["multi_class"] = multi_class
61-
6249
# The default scikit-learn solver `lbfgs` (v0.22) does not support the
6350
# l1 penalty.
6451
solver, penalty = params.pop("solver"), params.get("penalty")

Orange/tests/test_logistic_regression.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,3 @@ def test_auto_solver(self):
156156

157157
def test_supports_weights(self):
158158
self.assertTrue(LogisticRegressionLearner().supports_weights)
159-
160-
def test_multi_class_deprecation(self):
161-
with self.assertWarns(OrangeDeprecationWarning):
162-
LogisticRegressionLearner(penalty="l1", multi_class="multinomial")
163-
now = datetime.now()
164-
if (now.year, now.month) >= (2026, 1):
165-
raise Exception("If Orange depends on scikit-learn >= 1.7, remove this test "
166-
"and any mention of multi_class in LogisticRegressionLearner.")

0 commit comments

Comments
 (0)