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

Skip to content

Commit 58dc3e6

Browse files
Sentient07Jeremiah Johnson
authored andcommitted
Improve warning message in ElasticNet (scikit-learn#8565)
1 parent 0e0b293 commit 58dc3e6

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