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
[ENH] Use LogisticRegressionCV instead of LogisticRegression to improve Decoder performance #3736
[ENH] Use LogisticRegressionCV instead of LogisticRegression to improve Decoder performance #3736
Conversation
👋 @michellewang Thanks for creating a PR! Until this PR is ready for review, you can include the [WIP] tag in its title, or leave it as a github draft. Please make sure it is compliant with our contributing guidelines. In particular, be sure it checks the boxes listed below.
For new features:
For bug fixes:
We will review it as quick as possible, feel free to ping us with questions if needed. |
Codecov Report
@@ Coverage Diff @@
## main #3736 +/- ##
==========================================
+ Coverage 91.57% 91.58% +0.01%
==========================================
Files 139 139
Lines 16572 16593 +21
Branches 3236 3243 +7
==========================================
+ Hits 15175 15196 +21
Misses 1394 1394
Partials 3 3
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Indeed, if we break the API we need to go through deprecation cycles. |
I have added a private helper function As a side note, I noticed that |
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.
LGTM, thx !
It will probably not affect performance with the current solver, because according to the documentation there is no warm-start when using |
Will merge tomorrow unless I hear otherwise. Thx ! |
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.
LGTM thanks @michellewang
Closes #2200.
Changes proposed in this pull request:
LogisticRegression
withLogisticRegressionCV
innilearn.decoding.decoder
param_grid
should now containCs
instead ofC
, meaning that any code that explicitly provides aparam_grid = {'C': [...]}
would now break. Does this mean this needs a deprecation cycle? If so how is this usually done?C
toCs
when processing theparam_grid
(with maybe a warning)LogisticRegressionCV
for both"logistic_l1"
and"logistic_l2"
.sklearn
also has aLassoCV
class, but its hyperparameters are different (alphas
instead ofCs
), so it seems like it would be better to useLogisticRegressionCV
for both the L1 and L2 regularization cases (to be consistent)LinearSVC
, notSVC
)