Skip to content

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

Merged

Conversation

thomasjpfan
Copy link
Member

Continues #18514

@glemaitre
Copy link
Member

X generated in our common test should not have enough feature and it raises the FutureWarning.

@amueller
Copy link
Member

conflict...

@amueller
Copy link
Member

error seems related

Base automatically changed from master to main January 22, 2021 10:53
@adrinjalali
Copy link
Member

tests still failing

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:
Copy link
Member

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?

Copy link
Member

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?

Copy link
Member Author

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.

@glemaitre glemaitre merged commit 96a96f1 into scikit-learn:main Feb 1, 2021
@glemaitre
Copy link
Member

Thanks @thomasjpfan

@glemaitre glemaitre mentioned this pull request Apr 22, 2021
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants