-
-
Notifications
You must be signed in to change notification settings - Fork 26.2k
ENH Adds get_feature_names_out for cross_decomposition #22119
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 Adds get_feature_names_out for cross_decomposition #22119
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!
[f"{class_name_lower}{i}" for i in range(est.x_weights_.shape[1])], | ||
dtype=object, | ||
) | ||
assert_array_equal(names_out, expected_names_out) |
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.
Maybe those tests could be extended to also assert that est.transform(X[:1]).shape[1] == expected_names_out.shape[0]
.
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.
The proposed check is in the common tests:
scikit-learn/sklearn/utils/estimator_checks.py
Lines 3954 to 3956 in 42a34e8
assert ( | |
len(feature_names_out) == n_features_out | |
), f"Expected {n_features_out} feature names, got {len(feature_names_out)}" |
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.
Actually this is already tested in the common test.
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 solved the conflicts and I will merge once the CIs are green.
Reference Issues/PRs
Address a part of #21308
What does this implement/fix? Explain your changes.
This PR add
get_feature_names_out
tocross_decomposition
estimators.