Expose n_iter_ in SVC/SVR#7461
Merged
rapids-bot[bot] merged 1 commit intorapidsai:mainfrom Nov 7, 2025
Merged
Conversation
csadorf
approved these changes
Nov 7, 2025
This PR exposes `n_iter_` in our `SVC` and `SVR` estimators. While doing so, we also deprecate the old meaning of `max_iter` (max outer iterations) in favor of a new meaning (max _total_ iterations). This new meaning aligns with sklearn's implementation, easing interop between the two. The deprecation cycle is implemented as: - 25.12: If a user passes in a non-default integer value, a warning is raised informing them of the deprecated meaning. The old behavior is still applied. To opt in to the new behavior (and silence the warning) they can pass an instance of `TotalIters` (an `int` subclass) instead. The `n_iter_` attribute reflects the number of total iterations. - 26.02: The `TotalIters` wrapper will be deprecated. A bare integer will now mean "max total iterations". - 26.04: The `TotalIters` wrapper will be fully removed.
Member
Author
|
/merge |
rapids-bot Bot
pushed a commit
that referenced
this pull request
Dec 12, 2025
…uctor (#7604) closes #7603 Fixes missing `epsilon` and `svmType` fields in the `SVC` class constructor's aggregate initialization of `SvmParameter`. After #7461 added `max_outer_iter` to `SvmParameter`, the constructor in `svc.cu` was updated but still omitted the final two fields: ```C++ // Before (missing epsilon and svmType): --param(SvmParameter{C, cache_size, max_outer_iter, -1, nochange_steps, tol, verbosity}) // After (explicit initialization): ++param(SvmParameter{C, cache_size, max_outer_iter, -1, nochange_steps, tol, verbosity, 0, C_SVC}) ``` While C++ value-initializes omitted aggregate members to zero, this behavior can vary across compilers and build configurations. The missing `svmType` field caused intermittent CI failures in `SmoSolverTest/0.SvcTest` with the error: > "Incorrect training: cannot calculate the constant in the decision function" This occurred because an undefined `svmType` value could cause the SMO solver to misinterpret training data, leading to invalid support vector selection. Authors: - Dante Gama Dessavre (https://github.com/dantegd) Approvers: - Divye Gala (https://github.com/divyegala) - Simon Adorf (https://github.com/csadorf) URL: #7604
rapids-bot Bot
pushed a commit
that referenced
this pull request
Dec 15, 2025
This is the 2nd part of the deprecation plan for changing the behavior of `max_iter` for `SVC`/`SVR`. Previously we added a `TotalIters` wrapper so users could opt-in to the new behavior, now we make the new behavior the default and deprecate the wrapper. `max_iter` now always places a limit on _total iterations_ in the solver. Follow-up to #7461. Authors: - Jim Crist-Harif (https://github.com/jcrist) Approvers: - Dante Gama Dessavre (https://github.com/dantegd) URL: #7612
mani-builds
pushed a commit
to mani-builds/cuml
that referenced
this pull request
Jan 11, 2026
…uctor (rapidsai#7604) closes rapidsai#7603 Fixes missing `epsilon` and `svmType` fields in the `SVC` class constructor's aggregate initialization of `SvmParameter`. After rapidsai#7461 added `max_outer_iter` to `SvmParameter`, the constructor in `svc.cu` was updated but still omitted the final two fields: ```C++ // Before (missing epsilon and svmType): --param(SvmParameter{C, cache_size, max_outer_iter, -1, nochange_steps, tol, verbosity}) // After (explicit initialization): ++param(SvmParameter{C, cache_size, max_outer_iter, -1, nochange_steps, tol, verbosity, 0, C_SVC}) ``` While C++ value-initializes omitted aggregate members to zero, this behavior can vary across compilers and build configurations. The missing `svmType` field caused intermittent CI failures in `SmoSolverTest/0.SvcTest` with the error: > "Incorrect training: cannot calculate the constant in the decision function" This occurred because an undefined `svmType` value could cause the SMO solver to misinterpret training data, leading to invalid support vector selection. Authors: - Dante Gama Dessavre (https://github.com/dantegd) Approvers: - Divye Gala (https://github.com/divyegala) - Simon Adorf (https://github.com/csadorf) URL: rapidsai#7604
mani-builds
pushed a commit
to mani-builds/cuml
that referenced
this pull request
Jan 11, 2026
This is the 2nd part of the deprecation plan for changing the behavior of `max_iter` for `SVC`/`SVR`. Previously we added a `TotalIters` wrapper so users could opt-in to the new behavior, now we make the new behavior the default and deprecate the wrapper. `max_iter` now always places a limit on _total iterations_ in the solver. Follow-up to rapidsai#7461. Authors: - Jim Crist-Harif (https://github.com/jcrist) Approvers: - Dante Gama Dessavre (https://github.com/dantegd) URL: rapidsai#7612
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.
This PR exposes
n_iter_in ourSVCandSVRestimators.While doing so, we also deprecate the old meaning of
max_iter(max outer iterations) in favor of a new meaning (max total iterations). This new meaning aligns with sklearn's implementation, easing interop between the two.The deprecation cycle is implemented as:
TotalIters(anintsubclass) instead. Then_iter_attribute reflects the number of total iterations.TotalIterswrapper will be deprecated. A bare integer will now mean "max total iterations".TotalIterswrapper will be fully removed.Fixes #7439. Part of #6966.