Use ensure_all_finite from scikit-learn 1.6.0 to avoid FutureWarning - #42
Open
yhay81 wants to merge 1 commit into
Open
Use ensure_all_finite from scikit-learn 1.6.0 to avoid FutureWarning#42yhay81 wants to merge 1 commit into
yhay81 wants to merge 1 commit into
Conversation
scikit-learn renamed check_X_y/check_array's force_all_finite to ensure_all_finite in 1.6.0 and keeps the old name only as a deprecated alias until 1.8.0. The wrappers switched names at >= 1.8.0, so every fit() on scikit-learn 1.6.x/1.7.x emitted a FutureWarning. Switch at 1.6.0. Fixes dholzmueller#41
Owner
|
Thanks! Some tests are failing for unrelated reasons:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #41.
check_X_y_wrapper/check_array_wrapperswitched fromforce_all_finitetoensure_all_finiteonly at scikit-learn>= 1.8.0, but scikit-learn introducedensure_all_finitein 1.6.0 and keepsforce_all_finiteas a deprecated alias (with aFutureWarning) until 1.8. This changes the threshold to1.6.0so that scikit-learn 1.6.x / 1.7.x no longer print the warning on everyfit().Verified on scikit-learn 1.6/1.7 (Kaggle image,
TabM_D_Classifier.fit): the warning disappears and results are unchanged (the argument value is passed through unmodified).🤖 Generated with Claude Code