MNT clean up class_weight in LogisticRegression - #34499
Conversation
|
@OmarManzoor ping |
|
Oh that was quick 😆 |
OmarManzoor
left a comment
There was a problem hiding this comment.
Thank you for the PR @lorentzenchr
| lbfgs_bridge = _LbfgsCallbackBridge( | ||
| callback_ctx, | ||
| estimator, | ||
| X, | ||
| y, | ||
| callback_metadata, | ||
| w0, | ||
| n_classes=n_classes, | ||
| is_binary=is_binary, | ||
| fit_intercept=fit_intercept, | ||
| coefs_order=coefs_order, | ||
| xp=xp, | ||
| device_=device_, | ||
| ) |
There was a problem hiding this comment.
The only concern is that this was originally using the original y not the encoded one. So will this still work as expected when we pass transformed values now?
There was a problem hiding this comment.
don't know. I rely on the tests. In my understanding, the object that LBFGS sees should be passed.
| lbfgs_bridge = _LbfgsCallbackBridge( | ||
| callback_ctx, | ||
| estimator, | ||
| X, | ||
| y, | ||
| callback_metadata, | ||
| w0, | ||
| n_classes=n_classes, | ||
| is_binary=is_binary, | ||
| fit_intercept=fit_intercept, | ||
| coefs_order=coefs_order, | ||
| xp=xp, | ||
| device_=device_, | ||
| ) |
There was a problem hiding this comment.
don't know. I rely on the tests. In my understanding, the object that LBFGS sees should be passed.
|
@lorentzenchr I think this generally looks good other than the one clarification related to |
I think this is fine and we can merge. No test complains. If it is a bug, we can fix it once detected. |
|
Okay enabling auto-merge! |
OmarManzoor
left a comment
There was a problem hiding this comment.
LGTM. Thank you @lorentzenchr
Co-authored-by: Omar Salman <[email protected]>
Reference Issues/PRs
Makes #33906 a bit easier.
What does this implement/fix? Explain your changes.
This PR cleans up the logic of
class_weightin LogisticRegression and similar functions.AI usage disclosure
None
Any other comments?