-
-
Notifications
You must be signed in to change notification settings - Fork 26.6k
DEP parameter penalty in LogisticRegression and LogisticRegressionCV #32659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lesteve
merged 41 commits into
scikit-learn:main
from
lorentzenchr:dep_logistic_penalty
Nov 26, 2025
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
78e2155
DEP penalty in LogisticRegression
lorentzenchr 3986510
DOC add whatsnew entry
lorentzenchr 37eeb63
DOC/FIX develop.rst
lorentzenchr 69b11b5
TST take care of warnings in tests
lorentzenchr 1cc08fb
CLN adapt deprecation of penalty throught codebase
lorentzenchr b0b243a
Merge branch 'main' into dep_logistic_penalty
lorentzenchr f85d664
CLN docstring
lorentzenchr dbbdb07
MNT add deprecation warning for l1_ratio=None and review comments
lorentzenchr eab936a
DEP change default of l1_ratios from "warn" to None, deprecate None a…
lorentzenchr c745f77
DOC docstring of l1_ratio and table of solver compatibility
lorentzenchr b3b50fa
CLN review comments
lorentzenchr f0f181a
Merge branch 'main' into dep_logistic_penalty
lorentzenchr 06f6d18
TST fix warnings in tests
lorentzenchr 2fe94f6
Merge branch 'main' into dep_logistic_penalty
lorentzenchr cacb942
CLN address review comments
lorentzenchr ff7df3c
CLN nitpick
lorentzenchr 2043b52
trigger CD
lorentzenchr 8eaa810
MNT l1_ratios="warn"
lorentzenchr 85a325f
CLN fix warnings in tests
lorentzenchr 9f63e57
[azure parallel] sprinkle with a few more l1_ratios
lesteve f988165
[azure parallel] one more l1_ratios
lesteve 527de21
This does not seem necessary
lesteve b002c22
[azure parallel] tweak changelog
lesteve e9ba34f
[azure parallel] an attempt at tweaking the changelog
lesteve 8fcb264
[azure parallel] yet another changelog tweak
lesteve 5991522
Revert "This does not seem necessary"
lesteve 7a71a56
[azure parallel] tweak
lesteve 370823f
[azure parallel] keep tweaking
lesteve 7e28999
tweak
lesteve f079c5d
tweaks in test
lesteve 36533a8
tweak warning wording
lesteve 32c26e2
Tweak wording of l1_ratios deprecation + default change
lesteve ffc7c97
[azure parallel] trigger CI
lesteve 0ed5277
[azure parallel] tweak changelog again
lesteve aea4cef
Update sklearn/svm/_bounds.py
jeremiedbb 3646004
Update sklearn/linear_model/_logistic.py
jeremiedbb 297b1cf
Apply suggestion from @jeremiedbb
jeremiedbb bdec717
lint
jeremiedbb 49ed659
warn for inconsistent penalty and l1_ratio values
jeremiedbb 983d6a5
lint
jeremiedbb 689dbee
ignore other warning in test
jeremiedbb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
doc/whats_new/upcoming_changes/sklearn.linear_model/32659.api.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| - Parameter `penalty` of :class:`linear_model.LogisticRegression` and | ||
| :class:`linear_model.LogisticRegressionCV` is deprecated and will be removed in | ||
| version 1.10. The equivalent behaviour can be obtained as follows: | ||
|
|
||
| - for :class:`linear_model.LogisticRegression` | ||
|
|
||
| - use `l1_ratio=0` instead of `penalty="l2"` | ||
| - use `l1_ratio=1` instead of `penalty="l1"` | ||
| - use `0<l1_ratio<1` instead of `penalty="elasticnet"` | ||
| - use `C=np.inf` instead of `penalty=None` | ||
|
|
||
| - for :class:`linear_model.LogisticRegressionCV` | ||
|
|
||
| - use `l1_ratios=(0,)` instead of `penalty="l2"` | ||
| - use `l1_ratios=(1,)` instead of `penalty="l1"` | ||
| - the equivalent of `penalty=None` is to have `np.inf` as an element of the `Cs` parameter | ||
|
|
||
| For :class:`linear_model.LogisticRegression`, the default value of `l1_ratio` | ||
| has changed from `None` to `0.0`. Setting `l1_ratio=None` is deprecated and | ||
| will raise an error in version 1.10 | ||
|
|
||
| For :class:`linear_model.LogisticRegressionCV`, the default value of `l1_ratios` | ||
| has changed from `None` to `"warn"`. It will be changed to `(0,)` in version | ||
| 1.10. Setting `l1_ratios=None` is deprecated and will raise an error in | ||
| version 1.10. | ||
|
|
||
| By :user:`Christian Lorentzen <lorentzenchr>`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.