-
-
Notifications
You must be signed in to change notification settings - Fork 26k
ENH Adds n_features_in_ checking in cross_decomposition #18741
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 n_features_in_ checking in cross_decomposition #18741
Conversation
|
conflict... |
error seems related |
tests still failing |
sklearn/utils/estimator_checks.py
Outdated
if is_regressor(estimator): | ||
y = rng.normal(size=n_samples) | ||
else: | ||
y = rng.randint(low=0, high=2, size=n_samples) | ||
y = _enforce_estimator_tags_y(estimator, y) | ||
|
||
if name in CROSS_DECOMPOSITION: |
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.
could you please add a comment as why this is needed for future reference?
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.
is it making sense to have this in _enforce_estimator_tags_y
with proper tags?
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 a quick fix, we acn put it into _enforce_estimator_tags_y
first without a tag. We do this name in CROSS_DECOMPOSITION
"hack" a bunch in estimator_checks
, it would be worth it to centralize.
An alternative would be to n_components=1
in _set_checking_parameters
for the cross_decomposition
. I went with this option for this PR.
Thanks @thomasjpfan |
Continues #18514