8000 TST Inject placeholder value for MeanShift.bandwidth by jjerphan · Pull Request #21501 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

TST Inject placeholder value for MeanShift.bandwidth #21501

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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sklearn/utils/estimator_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,11 @@ def _set_checking_parameters(estimator):
if "n_init" in params:
# K-Means
estimator.set_params(n_init=2)
if name == "MeanShift":
# In the case of check_fit2d_1sample, bandwidth is set to None and
# is thus estimated. De facto it is 0.0 as a single sample is provided
# and this makes the test fails. Hence we give it a placeholder value.
estimator.set_params(bandwidth=1.0)

if name == "TruncatedSVD":
# TruncatedSVD doesn't run with n_components = n_features
Expand Down
0