-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
ENH Deprecate class_weight_
in regression/single class models in SVM module
#22898
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
- Removed instation of `class_weight_ = np.empty(0)` in `BaseLibSVM` - Added deprecated properties for `class_weight_` and `n_support_` in `SVR`, `NuSVR`, and `OneClassSVM`.
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
- Updated tests to use `n_support_[0]` directly - Added deprecated property to `SVR, NuSVR, OneClassSVM` - Removed partial `n_support_` deprecation in parent `BaseLibSVM` - Removed reliance on `n_support_` in `_validate_for_predict`
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.
Thank you for the update!
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
…-learn into deprecate_in_svr
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
class_weight_
and n_support_
in regression/single class models in SVM moduleclass_weight_
in regression/single class models in SVM module
class_weight_
in regression/single class models in SVM moduleclass_weight_
in regression/single class models in SVM module
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.
Thank you for your this contribution, @Micky774.
Here are a few comments.
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.
Minor comment, otherwise LGTM
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.
It took me time to get it but it looks correct and the tests pass without raising the warning when it should not be raised.
The trick to look at the _validate_targets
method that is overridden in the classifier base class BaseSVC
that defines the public class_weight_
only for classifiers.
Reference Issues/PRs
Fixes #14788
What does this implement/fix? Explain your changes.
Began deprecation of some properties in svm module
class_weight_ = np.empty(0)
inBaseLibSVM
_class_weight
inBaseLibSVM
to serve as an intermediate for deprecation by avoiding direct calls toclass_weight_
forSVR
,NuSVR
, andOneClassSVM
Any other comments?