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

FIX correct NeighborhoodComponentsAnalysis (NCA) _n_features_out value #28306

Merged
merged 6 commits into from Feb 28, 2024

Conversation

brendanlu
Copy link
Contributor

Reference Issues/PRs

Fixes #28293

What does this implement/fix? Explain your changes.

Implements the changes as suggested by @johentsch, similar to the base pca class.

Any other comments?

Adjusted the (faulty?) existing test logic to pick this issue up.

Copy link

github-actions bot commented Jan 29, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: b247cd7. Link to the linter CI: here

@brendanlu
Copy link
Contributor Author

@glemaitre friendly ping here: is this fix still needed?

@glemaitre
Copy link
Member

I have to make a deeper review but we need to add a new non-regression test to reproduce the failure seen in the issue and make sure that the changes are fixing it. We also need to add an entry in the changelog under the 1.4.2 version. I'll add the milestone.

@glemaitre glemaitre added this to the 1.4.2 milestone Feb 19, 2024
@glemaitre glemaitre self-requested a review February 19, 2024 09:59
Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

So you can add this entry in the 1.4.2 changelog:

:mod:`sklearn.neighbors`
........................

- |Fix| Fixes :class:`neighbors.NeighborhoodComponentsAnalysis` such that
  `get_feature_names_out` returns the correct number of feature names.
  :pr:`28306` by :user:`Brendan Lu <brendanlu>`.

sklearn/neighbors/tests/test_nca.py Outdated Show resolved Hide resolved
sklearn/neighbors/tests/test_nca.py Show resolved Hide resolved
sklearn/neighbors/tests/test_nca.py Outdated Show resolved Hide resolved
@glemaitre glemaitre self-requested a review February 20, 2024 10:22
Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @brendanlu

Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @brendanlu

@jeremiedbb jeremiedbb merged commit 783e98f into scikit-learn:main Feb 28, 2024
30 checks passed
@jeremiedbb jeremiedbb added the To backport PR merged in master that need a backport to a release branch defined based on the milestone. label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:neighbors To backport PR merged in master that need a backport to a release branch defined based on the milestone.
Projects
None yet
3 participants