-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[MRG] Use check_finite=False in sklearn.manifold #18886
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
[MRG] Use check_finite=False in sklearn.manifold #18886
Conversation
This is possible as Gi is constructed from X which has been validated in `NeighborsBase._fit`.
This is possible as Ci is constructed from Gi which is constructed from X which has been validated in `NeighborsBase._fit`.
This is possible as Yi is finite by construction from the eigenvectors of Ci (which is symetric) contained in U.
X and Y contain finite values by assumption. Hence so do C, G and trace. v contain finite values by assumption. Thus we can remove the check on the call to `solve`.
This is possible as X_nbrs is constructed from X which has been validated in `NeighborsBase._fit`.
This is possible as C_nbrs is constructed from X which has been validated in `NeighborsBase._fit`.
This is possible as Xi is constructed from X which has been validated in `NeighborsBase._fit`.
This is possible as Ci is constructed from Gi which is constructed from X which has been validated in `NeighborsBase._fit`.
@mathschy: shall you be interested again, feel free to review. |
I just have 2 small uncertainties I do not know how to resolve myself, otherwise LGTM. @jjerphan you may want to retry some checks in the CI ? |
@jjerphan actually I think you can also add a check_finite=False in line 333 of _spectral_embedding.py because the laplacian is already checked on line 325 Edit : I finished my review |
It looks like the failure is unrelated to those changes — see the traces of #18883. |
As @mathschy pointed out, `laplacian` is already verified line 325.
as reg might not be finite.
as eigh might return non-finite values.
6fcf933
to
b2aeaba
Compare
Hi @thomasjpfan, would you also be interested to review this pull request? 🙂 |
Those changes are made accordingly to @thomasjpfan's comments in scikit-learn#18886.
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
@ogrisel: are you interested to review this (rather pretty short) PR? 🙂 |
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 @jjerphan , LGTM.
Reference Issues/PRs
Treats #18837 for
sklearn.manifold
.What does this implement/fix? Explain your changes.
It removes the check for non-finite values on
scipy.linalg
functions when previous checks exist in thesklearn.manifold
module.Any other comments?
For reference:
I gave some indications in each commit message. The only call that I haven't modified is this one:
scikit-learn/sklearn/manifold/_t_sne.py
Line 364 in 8d7d4c7