Skip to content

CI Fix cuml.svm compatibility with scikit-learn 1.9 deprecation of probability= - #7981

Merged
rapids-bot[bot] merged 3 commits into
NVIDIA:mainfrom
betatim:fix-svc-effective_probability
Apr 28, 2026
Merged

CI Fix cuml.svm compatibility with scikit-learn 1.9 deprecation of probability=#7981
rapids-bot[bot] merged 3 commits into
NVIDIA:mainfrom
betatim:fix-svc-effective_probability

Conversation

@betatim

@betatim betatim commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

closes #7838

scikit-learn 1.9 will deprecate the probability parameter of the SVC estimators. Our as_sklearn and some tests needed adjusting to either not pass this or pick up an new private attribute.

I've tried to transition all our tests to use the new recommended CalibratedClassifierCV(SVC(), ensemble=False) pattern. There is one test that silences a warning, the one that tests round tripping (as_sklearn/from_sklearn). I think we should change our as_sklearn to return a CalibratedClassifierCV(...) when probability=True. Or maybe we also drop probability as a hyper-parameter? Bottom line, making that decision needs input from others and maybe makes the scope of this PR a bit too big. So for now I silenced the warning.

probability

scikit-learn 1.9 will deprecate the `probability` parameter of the SVC
estimators. Our `as_sklearn` and some tests needed adjusting to either
not pass this or pick up an new private attribute.
@copy-pr-bot

This comment was marked as outdated.

@github-actions github-actions Bot added the Cython / Python Cython or Python issue label Apr 22, 2026
@betatim betatim changed the title Fix cuml.svm compatibility with scikit-learn 1.9 deprecation of probability= CI Fix cuml.svm compatibility with scikit-learn 1.9 deprecation of probability= Apr 22, 2026
@betatim

This comment was marked as outdated.

Comment thread python/cuml/cuml/accel/_overrides/sklearn/svm.py Outdated
Comment thread python/cuml/cuml/svm/svc.py Outdated
Comment thread python/cuml/cuml/svm/svm_base.pyx

@jcrist jcrist left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for working on this! I think this is a good path to get things in now.

In the medium term I am very pro deprecating our probability=True support in SVC (and LinearSVC, which sklearn doesn't do either). Internally we effectively use CalibratedClassifier, but we don't generate the same _probA/_probB that sklearn would currently. I'd be happy to see this complication gone and rely on CalibratedClassifier explicitly. Simpler code, better separation of concerns.

Comment thread python/cuml/cuml/svm/svc.py Outdated
Comment thread python/cuml/cuml/svm/svm_base.pyx
Comment thread python/cuml/tests/test_sklearn_import_export.py Outdated
Comment thread python/cuml/cuml/accel/_overrides/sklearn/svm.py Outdated
@betatim betatim added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Apr 22, 2026
@betatim

This comment was marked as outdated.

@betatim

betatim commented Apr 27, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 2fdb19c

@betatim
betatim marked this pull request as ready for review April 28, 2026 07:44
@betatim
betatim requested a review from a team as a code owner April 28, 2026 07:44
@betatim
betatim requested a review from viclafargue April 28, 2026 07:44
@coderabbitai

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

@csadorf csadorf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks a lot!

Comment on lines +204 to +205
# sklearn 1.9 changed the default of `probability` from False to the
# sentinel string "deprecated"; coerce to the bool cuml uses.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(potential follow-up) Should we deprecate this for cuML's SVC as well?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think so (and also in LinearSVC) - see #7982.

@jcrist jcrist left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:shipit:

@jcrist

jcrist commented Apr 28, 2026

Copy link
Copy Markdown
Member

/merge

@rapids-bot
rapids-bot Bot merged commit f4e1a55 into NVIDIA:main Apr 28, 2026
171 of 174 checks passed
@betatim
betatim deleted the fix-svc-effective_probability branch April 29, 2026 07:30
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.

[CI] SVM and explainer tests fail on wheel-tests with nightly-deps on scikit-learn API changes

5 participants