MNT helper _nan_to_num function for array API #30637
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
Towards #26024
What does this implement/fix? Explain your changes.
Adding a function that might be useful for implementing Array API in
silhouette_samples
(and inBaseSearchCV._format_results._store()
if we want that), wherenp.nan_to_num
is used. I did not further check on these two.(It was a by-product of #30440 and #30562, but due to selecting a different approach, not needed there anymore.)
Any other comments?
It is unclear if this function will be needed in the future (depending on how this will be decided in the corresponding array api issue and also depending on if we want to make
silhouette_samples
fully using all kinds of array or only make it compatible by only accepting all kind of array inputs). I don't mind if we don't do anything with this PR until it becomes clearer from the array api side how to handle this in the future.