-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
TST use global_dtype in sklearn/manifold/tests/test_isomap.py #22673
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/manifold/tests/test_isomap.py #22673
Conversation
test_isomap.py
to test implementations on 32bit datasets
According to some irl discussions, such tests should only be added after Let's keep this PR open in the mean time. |
# TODO: Isomap fit/fit_transform must preserve dtype | ||
|
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.
you can now remove this comment
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.
Done as part of 1d72c03.
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com> Co-authored-by: Jérémie du Boisberranger <jeremiedbb@users.noreply.github.com>
Hum, I do not know why some like (mainly |
And the differences are huge. |
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 failures only show up in one job because we only enable float32 in this job :)
It turns out that Isomap don't really preserve float32. I found that transform
doesn't. The common test only checks fit_transform
:( I'll open a PR to extend the common test.
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Upgrading the branch since we merged the |
There's 1 remaining failing test: After investigation, it seems that it comes from the KernelCenterer which is used to compute the reconstruction error. When we compute it from float32 data or float64 data (that are close to some tolerance) the results are not always close to a reasonable tolerance. I think it's due to some kind of catastrophic cancellation. Indeed it's supposed to compute I'm not sure what to do here. We could:
|
I think that this is a good candidate for skipping the test in 32 bits. |
I agree. It only concerns the computation of the reconstruction error. The KernelCenterer is probably not widely used and thus not worth the added complexity and maintenance burden. @jjerphan, let's just not enable global_dtype for test_isomap_reconstruction_error but add a comment instead explaining that we don't run this test on float32 due to numerical instabilities from the KernelCenterer used in the reconstruction_error method. |
Co-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
…-learn#22673) Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com> Co-authored-by: Jérémie du Boisberranger <jeremiedbb@users.noreply.github.com>
…-learn#22673) Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com> Co-authored-by: Jérémie du Boisberranger <jeremiedbb@users.noreply.github.com>
…-learn#22673) Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com> Co-authored-by: Jérémie du Boisberranger <jeremiedbb@users.noreply.github.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com> Co-authored-by: Jérémie du Boisberranger <jeremiedbb@users.noreply.github.com>
Reference Issues/PRs
Partially addresses #22881
Precedes #22590
What does this implement/fix? Explain your changes.
This parametrizes tests from
test_isomap.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.