diff --git a/benchmarks/bench_rcv1_logreg_convergence.py b/benchmarks/bench_rcv1_logreg_convergence.py index e8fce1c414abf..2254ab81f30a4 100644 --- a/benchmarks/bench_rcv1_logreg_convergence.py +++ b/benchmarks/bench_rcv1_logreg_convergence.py @@ -240,7 +240,7 @@ def get_max_squared_sum(X): SGDClassifier( alpha=1.0 / C / n_samples, penalty="l2", - loss="log", + loss="log_loss", fit_intercept=fit_intercept, verbose=0, ), diff --git a/sklearn/linear_model/_logistic.py b/sklearn/linear_model/_logistic.py index 6680d60cb4b1c..745fcbced7016 100644 --- a/sklearn/linear_model/_logistic.py +++ b/sklearn/linear_model/_logistic.py @@ -1013,7 +1013,7 @@ class LogisticRegression(LinearClassifierMixin, SparseCoefMixin, BaseEstimator): See Also -------- SGDClassifier : Incrementally trained logistic regression (when given - the parameter ``loss="log"``). + the parameter ``loss="log_loss"``). LogisticRegressionCV : Logistic regression with built-in cross validation. Notes diff --git a/sklearn/tests/test_multioutput.py b/sklearn/tests/test_multioutput.py index ad95282fa6614..371c516f197c5 100644 --- a/sklearn/tests/test_multioutput.py +++ b/sklearn/tests/test_multioutput.py @@ -202,8 +202,8 @@ def test_hasattr_multi_output_predict_proba(): # check predict_proba passes def test_multi_output_predict_proba(): - sgd_linear_clf = SGDClassifier(random_state=1, max_iter=5, loss="log_loss") - param = {"loss": ("hinge", "log", "modified_huber")} + sgd_linear_clf = SGDClassifier(random_state=1, max_iter=5) + param = {"loss": ("hinge", "log_loss", "modified_huber")} # inner function for custom scoring def custom_scorer(estimator, X, y): @@ -213,7 +213,11 @@ def custom_scorer(estimator, X, y): return 0.0 grid_clf = GridSearchCV( - sgd_linear_clf, param_grid=param, scoring=custom_scorer, cv=3 + sgd_linear_clf, + param_grid=param, + scoring=custom_scorer, + cv=3, + error_score="raise", ) multi_target_linear = MultiOutputClassifier(grid_clf) multi_target_linear.fit(X, y)