Skip to content

Commit ca88f91

Browse files
committed
Merge pull request scikit-learn#5673 from amueller/sag_dont_warn_on_auto
[MRG + 1] FIX we shouldn't warn the user if the solver is auto
2 parents 83313de + 1321667 commit ca88f91

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sklearn/linear_model/ridge.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,10 @@ def ridge_regression(X, y, alpha, sample_weight=None, solver='auto',
293293
This function won't compute the intercept.
294294
"""
295295
if return_intercept and sparse.issparse(X) and solver != 'sag':
296-
warnings.warn("In Ridge, only 'sag' solver can currently fit the "
297-
"intercept when X is sparse. Solver has been "
298-
"automatically changed into 'sag'.")
296+
if solver != 'auto':
297+
warnings.warn("In Ridge, only 'sag' solver can currently fit the "
298+
"intercept when X is sparse. Solver has been "
299+
"automatically changed into 'sag'.")
299300
solver = 'sag'
300301

301302
# SAG needs X and y columns to be C-contiguous and np.float64

0 commit comments

Comments
 (0)