-
-
Notifications
You must be signed in to change notification settings - Fork 26.1k
DOC Clarify 'ovr' as the default strategy in the SVM documentation #29651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC Clarify 'ovr' as the default strategy in the SVM documentation #29651
Conversation
…multi-class classification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @Shashank1202. I would like to emphasize that this is a duplicate of #29363 and in general it is not a good practice to create duplicates without the OP consent.
I still made some suggestions because I think the general rewording is a better solution.
doc/modules/svm.rst
Outdated
@@ -119,12 +119,14 @@ Multi-class classification | |||
-------------------------- | |||
|
|||
:class:`SVC` and :class:`NuSVC` implement the "one-versus-one" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:class:`SVC` and :class:`NuSVC` implement the "one-versus-one" | |
:class:`SVC` and :class:`NuSVC` implement the "one-versus-one" ('ovo') |
doc/modules/svm.rst
Outdated
classifiers, with each one training data from two classes. | ||
By default, however, the `decision_function_shape` parameter is set to `'ovr'` | ||
(one-vs-rest), providing a consistent interface with other classifiers. | ||
|
||
The ``decision_function_shape`` option allows for the results of the "one-versus-one" | ||
classifiers to be monotonically transformed into a "one-vs-rest" decision | ||
function of shape ``(n_samples, n_classes)``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
classifiers, with each one training data from two classes. | |
By default, however, the `decision_function_shape` parameter is set to `'ovr'` | |
(one-vs-rest), providing a consistent interface with other classifiers. | |
The ``decision_function_shape`` option allows for the results of the "one-versus-one" | |
classifiers to be monotonically transformed into a "one-vs-rest" decision | |
function of shape ``(n_samples, n_classes)``. | |
classifiers, each trained on data from two classes. Internally, the solver | |
always uses this ovo strategy to train the models. However, by default, the | |
`decision_function_shape` parameter is set to `'ovr'` (one-vs-rest), to have | |
a consistent interface with other classifiers by transforming the ovo results | |
into a "one-vs-rest" decision matrix of shape ``(n_samples, n_classes)``. |
I've merged the other PR. This PR can now improve upon that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I synchronized with main and applied the requested changes. LGTM. Thanks
Fix documentation to specify default decision_function_shape as 'ovr'
This update corrects the scikit-learn documentation for
SVC
andNuSVC
to clearly state that the default setting for thedecision_function_shape
parameter is'ovr'
(one-vs-rest), not'ovo'
(one-versus-one). This improves clarity and resolves the discrepancy reported in issue #29340.