Skip to content
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 do not allocate local arrays in Ridge*CV of store_cv_values is False #15652

Merged

Conversation

glemaitre
Copy link
Contributor

Reference Issues/PRs

closes #15182

What does this implement/fix? Explain your changes.

Do not store a local variable storing all cv_values if not requested.

Any other comments?

@glemaitre glemaitre added this to the 0.22 milestone Nov 18, 2019
@glemaitre
Copy link
Contributor Author

ping @adrinjalali @jeromedockes @qinhanmin2014 This is the part which is easily mergeable from #15648 and could be included in the release

@glemaitre
Copy link
Contributor Author

and @agramfort

@glemaitre glemaitre changed the title ENH do not allocate local arrays in Ridge*CV of store_cv_vales is False ENH do not allocate local arrays in Ridge*CV of store_cv_values is False Nov 18, 2019
@glemaitre glemaitre mentioned this pull request Nov 18, 2019
@adrinjalali
Copy link
Member

@glemaitre
Copy link
Contributor Author

Nop because we slightly change the if branching we probably do not have a test to check that. I will add one right now.

@glemaitre
Copy link
Contributor Author

Good to go @adrinjalali

[(RidgeCV(), make_regression),
(RidgeClassifierCV(), make_classification)]
)
def test_ridge_gcv_cv_values_not_stored(ridge, make_dataset):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that the previous implementation would have passed this test because the cv values were stored in a local variable during fit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True and we don't have a real good test to detect the enhancement actually.

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the hack too, and the rest looks find. But it's true that we can't really test this.

@jnothman
Copy link
Member

jnothman commented Nov 18, 2019 via email

Copy link
Member

@qinhanmin2014 qinhanmin2014 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps follow Joel's comment and move it to 0.23.
I guess this is not so important now because there're lots of bugs in RidgeCV/RidgeClassifierCV. Hopefully we can work together and fix them before 0.23. (I even wish to fix RIdgeCV/RIdgeClassifierCV in 0.22.X if possible.)

@glemaitre
Copy link
Contributor Author

@adrinjalali @qinhanmin2014 Could we merge this PR. I moved the whats new in 0.23

@glemaitre
Copy link
Contributor Author

it will be helpful for reviewing #14848

Copy link
Member

@qinhanmin2014 qinhanmin2014 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I proposed some tests in #15648

doc/whats_new/v0.23.rst Outdated Show resolved Hide resolved
doc/whats_new/v0.23.rst Outdated Show resolved Hide resolved
@glemaitre
Copy link
Contributor Author

@qinhanmin2014 regarding the tests, it will be the next steps.
Can we merge this one. I fix the what's new entries

@qinhanmin2014
Copy link
Member

@qinhanmin2014 regarding the tests, it will be the next steps.

Yes, I just want to inform you that there're some new tests there.

@qinhanmin2014 qinhanmin2014 merged commit 54da2f0 into scikit-learn:master Dec 9, 2019
panpiort8 pushed a commit to panpiort8/scikit-learn that referenced this pull request Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

_RidgeGCV stores LOO predictions even when not required
5 participants