-
-
Notifications
You must be signed in to change notification settings - Fork 26k
API add option dual="auto"
for LinearSVC/LinearSVR
#24731
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
Conversation
dual="auto"
for LinearSVC/LinearSVR
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.
In addition, we will need some tests. Since we will run some deprecation, we need to be sure that we raise the proper warning regarding the change of the default in the future.
In addition, we need to check that "auto"
does what we expect.
@@ -37,9 +37,11 @@ class LinearSVC(LinearClassifierMixin, SparseCoefMixin, BaseEstimator): | |||
square of the hinge loss. The combination of ``penalty='l1'`` | |||
and ``loss='hinge'`` is not supported. | |||
|
|||
dual : bool, default=True | |||
dual : {"auto", False, True}, default= "auto" |
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 think that we still need to keep the default as-is and make a deprecation cycle to change the default in 1.4
dual : {"auto", False, True}, default= "auto" | |
dual : "auto" or bool, default=True |
Sets dual = False when n_samples > n_features if dual is "auto" | ||
and dual = True otherwise. |
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.
Sets dual = False when n_samples > n_features if dual is "auto" | |
and dual = True otherwise. | |
`dual="auto"` is equivalent to `dual=False` when | |
`n_samples > n_features` and `dual=True` otherwise. |
optimization problem. Prefer dual=False when n_samples > n_features. | ||
optimization problem. | ||
Sets dual = False when n_samples > n_features if dual is "auto" | ||
and dual = True otherwise. | ||
|
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.
.. versionchanged:: 1.4 | |
The default value will change from `True` to `"auto"` in 1.4. |
@@ -210,7 +212,7 @@ def __init__( | |||
penalty="l2", | |||
loss="squared_hinge", | |||
*, | |||
dual=True, | |||
dual="auto", |
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.
For making the change for the future, you can check the following documentation: https://scikit-learn.org/dev/developers/contributing.html#change-the-default-value-of-a-parameter
Sets dual = False when n_samples > n_features if dual is "auto" | ||
and dual = True otherwise. |
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.
Sets dual = False when n_samples > n_features if dual is "auto" | |
and dual = True otherwise. | |
`dual="auto"` is equivalent to `dual=False` when | |
`n_samples > n_features` and `dual=True` otherwise. | |
.. versionchanged:: 1.4 | |
The default value will change from `True` to `"auto"` in 1.4. |
@@ -362,9 +367,11 @@ class LinearSVR(RegressorMixin, LinearModel): | |||
To lessen the effect of regularization on synthetic feature weight | |||
(and therefore on the intercept) intercept_scaling has to be increased. | |||
|
|||
dual : bool, default=True | |||
dual : {"auto", False, True}, default= "auto" |
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.
dual : {"auto", False, True}, default= "auto" | |
dual : "auto" or bool, default=True |
The CI tell us that we need to modify the We also need to acknowledge the change in the changelog by adding an entry in |
Reference Issues/PRs
In reference to issue #24651. The original issue is updated with the relevant benchmarks in the comments.
What does this implement/fix? Explain your changes.
Sets the default value to "auto" and selects if the problem needs to be solved in primal or dual.
Any other comments?