-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MRG] Change default solver in LogisticRegression #11476
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
Closed
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
8f708da
Change default solver in LogisticRegression
TomDLT 83a5dec
simpler auto solver
TomDLT 25f343d
Merge branch 'master' into logistic_default
TomDLT 679224b
fix tests
TomDLT a9219e8
fix more tests
TomDLT 284ecaa
fix doctests
TomDLT cc53212
remove 'auto' solver
TomDLT 57b8364
add whats_new entry
TomDLT 1e21983
fix doctests
TomDLT 85f0ecc
cleaning
TomDLT d06bad1
only warn for multi_class default if the problem is not binary
TomDLT 636e1c0
Merge branch 'master' into logistic_default
TomDLT 94e7927
minor change
TomDLT 7342030
FIX doctests
TomDLT 0ccf0b9
FIX doctest...
TomDLT 115d34d
Revert "only warn for multi_class default if the problem is not binary"
TomDLT 91be8bf
This is an API change, not a feature
jnothman f7cd2fe
Merge branch 'master' into logistic_default
rth bf3a7fd
Decrease numerical precision in LogisticRegression doctest
rth ec86d3b
More review comments
rth 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -775,15 +775,20 @@ The "saga" solver [7]_ is a variant of "sag" that also supports the | |
non-smooth `penalty="l1"` option. This is therefore the solver of choice | ||
for sparse multinomial logistic regression. | ||
|
||
In a nutshell, one may choose the solver with the following rules: | ||
|
||
================================= ===================================== | ||
Case Solver | ||
================================= ===================================== | ||
L1 penalty "liblinear" or "saga" | ||
Multinomial loss "lbfgs", "sag", "saga" or "newton-cg" | ||
Very Large dataset (`n_samples`) "sag" or "saga" | ||
================================= ===================================== | ||
In a nutshell, the following table summarizes the solvers characteristics: | ||
|
||
============================ =========== ======= =========== ===== ====== | ||
solver 'liblinear' 'lbfgs' 'newton-cg' 'sag' 'saga' | ||
============================ =========== ======= =========== ===== ====== | ||
Multinomial + L2 penalty no yes yes yes yes | ||
OVR + L2 penalty yes yes yes yes yes | ||
Multinomial + L1 penalty no no no no yes | ||
OVR + L1 penalty yes no no no yes | ||
============================ =========== ======= =========== ===== ====== | ||
Penalize the intercept (bad) yes no no no no | ||
Faster for large datasets no no no yes yes | ||
Robust to unscaled datasets yes yes yes no no | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This table is great! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah really good! |
||
============================ =========== ======= =========== ===== ====== | ||
|
||
The "saga" solver is often the best choice. The "liblinear" solver is | ||
used by default for historical reasons. | ||
|
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol. Now the example is not very interesting any more.