Skip to content

Use ensure_all_finite from scikit-learn 1.6.0 to avoid FutureWarning - #42

Open
yhay81 wants to merge 1 commit into
dholzmueller:mainfrom
yhay81:fix-sklearn-ensure-all-finite-threshold
Open

Use ensure_all_finite from scikit-learn 1.6.0 to avoid FutureWarning#42
yhay81 wants to merge 1 commit into
dholzmueller:mainfrom
yhay81:fix-sklearn-ensure-all-finite-threshold

Conversation

@yhay81

@yhay81 yhay81 commented Sep 3, 2026

Copy link
Copy Markdown

Fixes #41.

check_X_y_wrapper / check_array_wrapper switched from force_all_finite to ensure_all_finite only at scikit-learn >= 1.8.0, but scikit-learn introduced ensure_all_finite in 1.6.0 and keeps force_all_finite as a deprecated alias (with a FutureWarning) until 1.8. This changes the threshold to 1.6.0 so that scikit-learn 1.6.x / 1.7.x no longer print the warning on every fit().

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

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
@dholzmueller

Copy link
Copy Markdown
Owner

Thanks! Some tests are failing for unrelated reasons:

  • Python 3.9 ones for some hatch compatibility issue (I would just drop python 3.9 support from pyproject.toml and the .github/workflows/testing.yml)
  • macos tests for some OpenMP-related issue. ChatGPT suggests as a fix to add to .github/workflows/testing.yml an OpenMP install like this:
- uses: actions/setup-python@v5
  with:
    python-version: ${{ matrix.python-version }}

- name: Install libomp
  if: runner.os == 'macOS'
  run: brew install libomp

- name: Install hatch
  run: uv pip install --system hatch

- name: Run tests
  run: hatch test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check_X_y_wrapper emits sklearn FutureWarning on scikit-learn 1.6/1.7 (threshold should be 1.6.0, not 1.8.0)

2 participants