MNT Removed redundant checks when calling scorer/get_scorer
@@ -1160,7 +1160,6 @@ def _log_reg_scoring_path(X, y, train, test, pos_class=None, Cs=10,
scores = list()
- if isinstance(scoring, str):
scoring = get_scorer(scoring)
for w in coefs:
if multi_class == 'ovr':
@@ -2242,7 +2241,7 @@ class LogisticRegressionCV(LogisticRegression, BaseEstimator,
"This warning will disappear in version 0.22.",
ChangedBehaviorWarning)
scoring = self.scoring or 'accuracy'
- if isinstance(scoring, str):
+
scoring = get_scorer(scoring)
return scoring(self, X, y, sample_weight=sample_weight)
