10000 Improve warning message in ElasticNet (#8565) · scikit-learn/scikit-learn@eba8a6a · GitHub
[go: up one dir, main page]

Skip to content

Commit eba8a6a

Browse files
Sentient07lesteve
authored andcommitted
Improve warning message in ElasticNet (#8565)
1 parent d01a02b commit eba8a6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sklearn/linear_model/cd_fast.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ def enet_coordinate_descent(np.ndarray[floating, ndim=1] w,
217217
cdef floating *R_data = <floating*> R.data
218218
cdef floating *XtA_data = <floating*> XtA.data
219219

220-
if alpha == 0:
221-
warnings.warn("Coordinate descent with alpha=0 may lead to unexpected"
220+
if alpha == 0 and beta == 0:
221+
warnings.warn("Coordinate descent with no regularization may lead to unexpected"
222222
" results and is discouraged.")
223223

224224
with nogil:

0 commit comments

Comments
 (0)
0