API Deprecate positional arguments in svm module#16973
API Deprecate positional arguments in svm module#16973adrinjalali merged 3 commits intoscikit-learn:masterfrom
Conversation
|
|
||
| def __init__(self, C=1.0, kernel='rbf', degree=3, gamma='scale', | ||
| @_deprecate_positional_args | ||
| def __init__(self, *, C=1.0, kernel='rbf', degree=3, gamma='scale', |
There was a problem hiding this comment.
I would leave C and nu positional, I think, but no strong preference.
There was a problem hiding this comment.
I think not. Too unclear with SVC(0.5)
|
|
||
| def __init__(self, C=1.0, kernel='rbf', degree=3, gamma='scale', | ||
| @_deprecate_positional_args | ||
| def __init__(self, *, C=1.0, kernel='rbf', degree=3, gamma='scale', |
There was a problem hiding this comment.
I think not. Too unclear with SVC(0.5)
|
|
||
| def __init__(self, kernel='rbf', degree=3, gamma='scale', | ||
| @_deprecate_positional_args | ||
| def __init__(self, *, kernel='rbf', degree=3, gamma='scale', |
There was a problem hiding this comment.
I'd consider kernel being positional in SVMs... but SVC has C in the way.
There was a problem hiding this comment.
Maybe that's something we can do once the deprecation cycle is over, because there would be no risk of breaking user code?
sklearn/svm/_classes.py
Outdated
| def __init__(self, penalty='l2', loss='squared_hinge', dual=True, tol=1e-4, | ||
| C=1.0, multi_class='ovr', fit_intercept=True, | ||
| @_deprecate_positional_args | ||
| def __init__(self, penalty='l2', *, loss='squared_hinge', dual=True, |
There was a problem hiding this comment.
any reason to make penalty positional but not the loss?
I feel like both are equally unambiguous given the possible names
|
|
||
| def __init__(self, kernel='rbf', degree=3, gamma='scale', | ||
| @_deprecate_positional_args | ||
| def __init__(self, *, kernel='rbf', degree=3, gamma='scale', |
There was a problem hiding this comment.
Maybe that's something we can do once the deprecation cycle is over, because there would be no risk of breaking user code?
* API Keyword only for svm * BUG Fix * CLN Address comments
* API Keyword only for svm * BUG Fix * CLN Address comments
Reference Issues/PRs
Towards #15005
CC @adrinjalali