From e489aab0d60ee48400e98f77abd92116620d9681 Mon Sep 17 00:00:00 2001 From: Thomas J Fan Date: Fri, 18 Oct 2019 12:55:25 -0400 Subject: [PATCH] MNT Remove warning in logistic regression cv scoring (#15184) --- sklearn/linear_model/logistic.py | 8 -------- sklearn/linear_model/tests/test_logistic.py | 3 +-- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/sklearn/linear_model/logistic.py b/sklearn/linear_model/logistic.py index 940891580eb44..6bb1f8608c473 100644 --- a/sklearn/linear_model/logistic.py +++ b/sklearn/linear_model/logistic.py @@ -2248,15 +2248,7 @@ def score(self, X, y, sample_weight=None): Score of self.predict(X) wrt. y. """ - - if self.scoring is not None: - warnings.warn("The long-standing behavior to use the " - "accuracy score has changed. The scoring " - "parameter is now used. " - "This warning will disappear in version 0.22.", - ChangedBehaviorWarning) scoring = self.scoring or 'accuracy' - scoring = get_scorer(scoring) return scoring(self, X, y, sample_weight=sample_weight) diff --git a/sklearn/linear_model/tests/test_logistic.py b/sklearn/linear_model/tests/test_logistic.py index 3f998212ddf6a..a16bde0d02c9d 100644 --- a/sklearn/linear_model/tests/test_logistic.py +++ b/sklearn/linear_model/tests/test_logistic.py @@ -129,8 +129,7 @@ def __call__(self, model, X, y, sample_weight=None): # reset mock_scorer mock_scorer.calls = 0 - with pytest.warns(ChangedBehaviorWarning): - custom_score = lr.score(X, lr.predict(X)) + custom_score = lr.score(X, lr.predict(X)) assert custom_score == mock_scorer.scores[0] assert mock_scorer.calls == 1