-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
ENH Add get_feature_names_out for random_projection module #21330
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 Add get_feature_names_out for random_projection module #21330
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.
LGTM. We might wait for #21079 to be merged, to both remember to use generate_names=False
and to add this PR in the changelog entry.
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.
Same opinion as @TomDLT.
144e1c0
to
e5766ef
Compare
@@ -24,7 +24,7 @@ | |||
|
|||
all_SparseRandomProjection: List[Any] = [SparseRandomProjection] | |||
all_DenseRandomProjection: List[Any] = [GaussianRandomProjection] | |||
all_RandomProjection = set(all_SparseRandomProjection + all_DenseRandomProjection) | |||
all_RandomProjection = all_SparseRandomProjection + all_DenseRandomProjection |
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.
This was done to avoid a pytest-xdist
error about workers collecting different tests (different order).
It does not seem that crucial that all_RandomProjection is a set
in this file.
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!
Merged! Thanks @lesteve. |
Reference Issues/PRs
Part of #21308.
What does this implement/fix? Explain your changes.
Adds
get_feature_names_out
to therandom_projection
module.Any other comments?
When #21079 gets merged, I could use
generate_names=False
in_check_feature_names_in
(see https://github.com/scikit-learn/scikit-learn/pull/21079/files#diff-962bea3f949b0a1e7b2ad40d2879f5d7ba1e6cd7da168daa82f84a87e800715e for more details) since the names of the output features don't reuse the names of the input features.