You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
linear_model.LogisticRegression's penalty=None case documentation #34090
Deprecated since version 1.8: penalty was deprecated in version 1.8 and will be removed in 1.10. Use l1_ratio instead. l1_ratio=0 for penalty='l2', l1_ratio=1 for penalty='l1' and l1_ratio set to any float between 0 and 1 for 'penalty='elasticnet'.
What about penalty=None case? It's omitted here.
But
Hi, I’d be interested in helping with this documentation clarification issue.
From my understanding, the current documentation explains how l1_ratio maps to the deprecated penalty values for 'l1', 'l2', and 'elasticnet', but does not mention the penalty=None case, which can make the transition guidance incomplete.
I also noticed the implementation/documentation mismatch mentioned in the issue regarding the elasticnet handling.
Once the issue is triaged, I’d be happy to work on a documentation clarification PR if that would be helpful.
Are integers intentional instead of floats here? l1_ratio is : float, when 0, 1 are integers.
On point 3, I think we could improve the docs as well. Of cause ints like 0 and 1 as also passable, but I'd suggest users to pass 0.0 and 1.0 in the docs, simply to make it more obvious that you can also pass 0.5, if you like.
tbh I wouldn't care too much. The docstring is already clear about l1_ratio being a float. Here we're talking about a deprecation notice that will be remove for the next release. In addition, the warnings mention "a float between 0 and 1" now so I really don't see where there could be a confusion (I expect that passing 1 is the same as passing 1.0).
Activity
parthbhattpy commentedon May 22, 2026
Hi, I’d be interested in helping with this documentation clarification issue.
From my understanding, the current documentation explains how
l1_ratiomaps to the deprecatedpenaltyvalues for'l1','l2', and'elasticnet', but does not mention thepenalty=Nonecase, which can make the transition guidance incomplete.I also noticed the implementation/documentation mismatch mentioned in the issue regarding the
elasticnethandling.Once the issue is triaged, I’d be happy to work on a documentation clarification PR if that would be helpful.
Parth Bhatt
StefanieSenger commentedon May 24, 2026
Hi @kuraga, thanks for reporting. I agree this is inconsistently documented and we should
FutureWarning.Happy if you or @parthbhattpy want to go forward and open a PR with a doc fix.
baynecheke commentedon May 25, 2026
I've opened a PR for this: #34107
kuraga commentedon May 26, 2026
@jeremiedbb thanks on merge!
Are there some thoughts on p. 3 ?
StefanieSenger commentedon May 27, 2026
On point 3, I think we could improve the docs as well. Of cause ints like 0 and 1 as also passable, but I'd suggest users to pass 0.0 and 1.0 in the docs, simply to make it more obvious that you can also pass 0.5, if you like.
jeremiedbb commentedon May 27, 2026
tbh I wouldn't care too much. The docstring is already clear about l1_ratio being a float. Here we're talking about a deprecation notice that will be remove for the next release. In addition, the warnings mention "a float between 0 and 1" now so I really don't see where there could be a confusion (I expect that passing 1 is the same as passing 1.0).