-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
EHN Improve variable names in KernelPCA
#19908
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
EHN Improve variable names in KernelPCA
#19908
Conversation
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.
We need to maintain backward compat for 2 releases (up to version 1.2 as 1.0 will be the next release).
Here is the contributors doc to help you add backward compat supporting code to this PR: https://scikit-learn.org/stable/developers/contributing.html#deprecation
sklearn/decomposition/_kernel_pca.py
Outdated
" set to True when instantiating and hence " | ||
"the inverse transform is not available.") | ||
if not self.enable_inverse_transform: | ||
raise NotFittedError("The enable_inverse_transform parameter was" |
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.
As the codecov bot discovered, the existing tests for not trigger this branch of the code. Could you please add a quick test for this (using pytest.raises(NotFittedError)
)?
Also the deprecated parameter and attribute should be documented in the |
I agree. I think I am fine with the |
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.
Thanks for this contribution @kstoneriv3, this makes using KernelPCA
clearer.
I've just have added two suggestions regarding linting.
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
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.
One last comment before approval. 🙂
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
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. Thank you @kstoneriv3!
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.
I solve the merge conflicts. LGTM. We will check that the CIs are still passing.
Co-authored-by: Kei Ishikawa <k.stoneriv@gmail.com> Co-authored-by: Julien Jerphanion <git@jjerphan.xyz> Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Kei Ishikawa <k.stoneriv@gmail.com> Co-authored-by: Julien Jerphanion <git@jjerphan.xyz> Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Reference Issues/PRs
See #19732 (comment)
What does this implement/fix? Explain your changes.
Change the ambiguous variable names in
KernelPCA
to address the following points.Any other comments?
I am not sure if changing
fit_inverse_tranform
toenable_inverse_transform
is the way to go.fit_inverse_transform
is a bit obscure but make it clear that we are using a learned pre-image.