-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
TST use global_dtype in sklearn/cluster/tests/test_mean_shift.py #22672
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
TST use global_dtype in sklearn/cluster/tests/test_mean_shift.py #22672
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.
Thanks for the PR.
I think at least one test (probably test_mean_shift
would make most sense) needs to explicitly check the impact of changing the dtype
of X
on the expected dtype
of ms.cluster_centers_
.
Intuitively I would expect ms.cluster_centers_.dtype == X.dtype
unless there is a good reason to systematically upcast to np.float64
, in which case it should probably be documented with an inline comment in the test and in the docstring of for the cluster_centers_
attribute.
I also realize that no test check the expected shape of ms.cluster_centers_
. I think test_mean_shift
should be updated to do that.
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
test_mean_shift.py
to test implementations on 32bit datasetsCo-authored-by: Jérémie du Boisberranger <jeremiedbb@users.noreply.github.com>
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. Just a few nitpicks
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 couple of comments.
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
…kit-learn#22672) Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> Co-authored-by: Jérémie du Boisberranger <jeremiedbb@users.noreply.github.com> Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Reference Issues/PRs
Partially addresses #22881
Precedes #22590
What does this implement/fix? Explain your changes.
This parametrizes tests from
test_mean_shift.py
to run on 32bit datasets.Any other comments?
We could introduce a mechanism to be able to able to remove tests' execution on 32bit datasets if this takes too much time to complete.