Skip to content

Apply new input validation to cuml.kernel_ridge - #8007

Merged
rapids-bot[bot] merged 2 commits into
NVIDIA:mainfrom
jcrist:validation-kernel-ridge
Apr 29, 2026
Merged

Apply new input validation to cuml.kernel_ridge#8007
rapids-bot[bot] merged 2 commits into
NVIDIA:mainfrom
jcrist:validation-kernel-ridge

Conversation

@jcrist

@jcrist jcrist commented Apr 23, 2026

Copy link
Copy Markdown
Member

Fixes #7996.

@jcrist
jcrist requested a review from a team as a code owner April 23, 2026 13:51
@jcrist
jcrist requested a review from csadorf April 23, 2026 13:51
@jcrist jcrist self-assigned this Apr 23, 2026
@github-actions github-actions Bot added the Cython / Python Cython or Python issue label Apr 23, 2026
@jcrist jcrist added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change cuml-accel Issues related to cuml.accel sklearn-api-compat Issues around cuml matching sklearn API conventions/standards and removed Cython / Python Cython or Python issue labels Apr 23, 2026
@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown

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: f0f7dd65-72ec-489c-ae78-dfc52adc864e

📥 Commits

Reviewing files that changed from the base of the PR and between 1ac1c31 and 047eb3e.

📒 Files selected for processing (2)
  • python/cuml/cuml_accel_tests/upstream/scikit-learn/xfail-list.yaml
  • python/cuml/tests/test_sklearn_compatibility.py
💤 Files with no reviewable changes (2)
  • python/cuml/tests/test_sklearn_compatibility.py
  • python/cuml/cuml_accel_tests/upstream/scikit-learn/xfail-list.yaml

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • KernelRidge now supports multi-output regression.
  • Improvements

    • Enhanced input validation and processing in KernelRidge.
    • Expanded scikit-learn compatibility with reduced test failures.

Walkthrough

Refactors KernelRidge input handling to use shared check_inputs flow, adds explicit multi-output support, ensures kernel outputs are CuPy arrays, tweaks solver dtype handling, and tightens xfail test expectations for KernelRidge compatibility checks.

Changes

Cohort / File(s) Summary
KernelRidge implementation
python/cuml/cuml/kernel_ridge/kernel_ridge.py
Replaced bespoke input conversion with check_inputs; fit now supports multi-output and preserves input index when storing X_fit_; _get_kernel forces CuPy output; _solve_cholesky_kernel uses cp.asarray; changed dual_coef casting source; added _more_static_tags(); changed @reflect(reset=True)@reflect(reset="type").
Test xfail mapping
python/cuml/cuml_accel_tests/upstream/scikit-learn/xfail-list.yaml, python/cuml/tests/test_sklearn_compatibility.py
Removed multiple KernelRidge xfail entries for input/target/sample-weight validation and certain training permutations, leaving a narrower xfail surface (pickle/readonly_memmap case).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Cython / Python

Suggested reviewers

  • csadorf
🚥 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 accurately summarizes the main change: applying new input validation to cuml.kernel_ridge, which aligns with the refactoring of input handling using check_inputs.
Description check ✅ Passed The description mentions fixing issue #7996, which directly relates to updating cuml.kernel_ridge to new input validation as shown in the changes.
Linked Issues check ✅ Passed The PR successfully implements the objective from issue #7996 to update cuml.kernel_ridge to new input validation by refactoring fit/predict to use check_inputs, adding multioutput support, and updating xfail test markers.
Out of Scope Changes check ✅ Passed All changes are in-scope: kernel_ridge.py refactoring for input validation, xfail-list.yaml adjustments reflecting improved compatibility, and test configuration updates removing expected failures that now pass.

✏️ 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.

@jcrist jcrist changed the title Apply new input validation to KernelRidge Apply new input validation to cuml.kernel_ridge Apr 23, 2026
@github-actions github-actions Bot added the Cython / Python Cython or Python issue label Apr 28, 2026
@jcrist

jcrist commented Apr 29, 2026

Copy link
Copy Markdown
Member Author

/merge

@rapids-bot
rapids-bot Bot merged commit 433697e into NVIDIA:main Apr 29, 2026
93 checks passed
@jcrist
jcrist deleted the validation-kernel-ridge branch April 29, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuml-accel Issues related to cuml.accel Cython / Python Cython or Python issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change sklearn-api-compat Issues around cuml matching sklearn API conventions/standards

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update cuml.kernel_ridge to new input validation

3 participants