Skip to content

A few fixes for sklearn 1.9 pre-release - #8126

Merged
rapids-bot[bot] merged 3 commits into
NVIDIA:release/26.06from
jcrist:fix-sklearn-19-nightly
May 19, 2026
Merged

A few fixes for sklearn 1.9 pre-release#8126
rapids-bot[bot] merged 3 commits into
NVIDIA:release/26.06from
jcrist:fix-sklearn-19-nightly

Conversation

@jcrist

@jcrist jcrist commented May 18, 2026

Copy link
Copy Markdown
Member

This addresses failures in python/cuml/tests and python/cuml/cuml_accel_tests when run with the most recent sklearn 1.9 pre-release. With one small exception, this just required a few tweaks to some tests.

I did not address any failures when running the upstream sklearn test suite with cuml.accel, as that would require much deeper changes to setup xfails.

@jcrist jcrist self-assigned this May 18, 2026
@jcrist
jcrist requested a review from a team as a code owner May 18, 2026 17:49
@jcrist
jcrist requested a review from dantegd May 18, 2026 17:49
@jcrist jcrist added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels May 18, 2026
@github-actions github-actions Bot added the Cython / Python Cython or Python issue label May 18, 2026
@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b43f6c6e-8d69-4d72-8894-e7f270488f1e

📥 Commits

Reviewing files that changed from the base of the PR and between a17e0f3 and eaedf26.

📒 Files selected for processing (5)
  • python/cuml/cuml/accel/_overrides/sklearn/preprocessing.py
  • python/cuml/cuml_accel_tests/integration/test_svc.py
  • python/cuml/cuml_accel_tests/integration/test_tsvd.py
  • python/cuml/tests/test_sklearn_compatibility.py
  • python/cuml/tests/test_sklearn_import_export.py
💤 Files with no reviewable changes (1)
  • python/cuml/tests/test_sklearn_compatibility.py
✅ Files skipped from review due to trivial changes (1)
  • python/cuml/cuml_accel_tests/integration/test_svc.py
🚧 Files skipped from review as they are similar to previous changes (3)
  • python/cuml/cuml_accel_tests/integration/test_tsvd.py
  • python/cuml/tests/test_sklearn_import_export.py
  • python/cuml/cuml/accel/_overrides/sklearn/preprocessing.py

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved TargetEncoder target validation and GPU training paths to prevent unsupported targets and ensure safe CPU fallback.
    • Removed certain compatibility xfails for KernelDensity and Naive Bayes variants (BernoulliNB, ComplementNB, CategoricalNB, MultinomialNB).
  • Tests

    • Suppressed scikit-learn deprecation warnings for SVC probability-related attributes.
    • Updated TSVD tests for version-dependent behavior and metadata.

Walkthrough

This PR refactors TargetEncoder GPU proxy methods to validate y and stop forwarding arbitrary kwargs, adds pytest warning filters for deprecated SVC attributes, updates TSVD test parameterization with a version gate for "QR", and removes several check_all_zero_sample_weights_error xfails.

Changes

Sklearn compatibility and GPU acceleration alignment

Layer / File(s) Summary
TargetEncoder GPU proxy validation alignment
python/cuml/cuml/accel/_overrides/sklearn/preprocessing.py
_gpu_fit signature removes **kwargs and _gpu_fit_transform renames **kwargs**params; both validate y via _check_targetencoder_y(y) before calling GPU fit/fit_transform.
SVC deprecation warning suppressions
python/cuml/cuml_accel_tests/integration/test_svc.py, python/cuml/tests/test_sklearn_import_export.py
Added pytest.mark.filterwarnings to ignore FutureWarnings about deprecated SVC probability and probA_/probB_ attributes.
TSVD power iteration normalizer test update
python/cuml/cuml_accel_tests/integration/test_tsvd.py
Updated header year and imports; added "QR" to power_iteration_normalizer parametrization and skip QR when sklearn < 1.9.0.
Estimator xfail cleanup for zero-weight samples
python/cuml/tests/test_sklearn_compatibility.py
Removed check_all_zero_sample_weights_error xfail entries for KernelDensity, BernoulliNB, ComplementNB, CategoricalNB, and MultinomialNB.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • rapidsai/cuml#8075: Updates TargetEncoder's GPU accel wrapper validation and _gpu_fit/_gpu_fit_transform forwarding of y during fitting.
  • rapidsai/cuml#7768: Modifies test_sklearn_compatibility.py xfail entries for overlapping estimators in the shared per-estimator configuration.

Suggested labels

cuml-accel, sklearn-api-compat

Suggested reviewers

  • dantegd
  • csadorf
  • betatim
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'A few fixes for sklearn 1.9 pre-release' directly matches the changeset, which contains fixes for sklearn 1.9 pre-release compatibility across multiple test files.
Description check ✅ Passed The description accurately explains that the PR addresses test failures in cuml/tests and cuml_accel_tests when run with sklearn 1.9 pre-release, matching the actual changes made.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@python/cuml/cuml/accel/_overrides/sklearn/preprocessing.py`:
- Around line 79-85: The _gpu_fit wrapper currently only accepts (self, X, y)
and loses keyword args like fold_ids, causing TypeError when forwarded to cuML's
GPU TargetEncoder; update the _gpu_fit method signature to accept **params
(matching _gpu_fit_transform), call _check_targetencoder_y(y) as before, and
forward those kwargs to self._gpu.fit(X, y, **params) so optional keywords such
as fold_ids are preserved.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 18be25d9-f9f2-400d-a714-9c25b879e0b9

📥 Commits

Reviewing files that changed from the base of the PR and between a4c824b and a17e0f3.

📒 Files selected for processing (5)
  • python/cuml/cuml/accel/_overrides/sklearn/preprocessing.py
  • python/cuml/cuml_accel_tests/integration/test_svc.py
  • python/cuml/cuml_accel_tests/integration/test_tsvd.py
  • python/cuml/tests/test_sklearn_compatibility.py
  • python/cuml/tests/test_sklearn_import_export.py
💤 Files with no reviewable changes (1)
  • python/cuml/tests/test_sklearn_compatibility.py

Comment thread python/cuml/cuml/accel/_overrides/sklearn/preprocessing.py
Comment thread python/cuml/cuml_accel_tests/integration/test_tsvd.py Outdated
jcrist added 2 commits May 18, 2026 16:25
This addresses failures in `python/cuml/tests` and
`python/cuml/cuml_accel_tests` when run with the most recent sklearn 1.9
pre-release.

I did not address any failures when running the upstream sklearn test
suite with `cuml.accel`, as that would require much deeper changes to
setup xfails.
@jcrist
jcrist force-pushed the fix-sklearn-19-nightly branch from a17e0f3 to eaedf26 Compare May 18, 2026 21:26
@jcrist
jcrist requested a review from csadorf May 18, 2026 21:27
@jcrist

jcrist commented May 19, 2026

Copy link
Copy Markdown
Member Author

/merge

@rapids-bot
rapids-bot Bot merged commit 673aa27 into NVIDIA:release/26.06 May 19, 2026
94 checks passed
@jcrist
jcrist deleted the fix-sklearn-19-nightly branch May 19, 2026 12:23
@jcrist

jcrist commented May 19, 2026

Copy link
Copy Markdown
Member Author

Completing the circle: the nightly run with the pre release passed last night: https://github.com/rapidsai/cuml/actions/runs/26085457458/job/76697334889

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

Labels

Cython / Python Cython or Python issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants