-
Notifications
You must be signed in to change notification settings - Fork 532
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
Support init arguments in MNMG LogisticRegression #5519
Conversation
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.
Looks goot @lijinf2 just a few minor things!
def __init__(self, *, handle=None): | ||
super().__init__(handle=handle) | ||
def __init__( | ||
self, |
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 other dask estimators, we pass **kwargs
through to the super class so that we don't need to specify the defaults twice in the cython layer. Is there a reason we can't do that here? As an example.
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.
The purpose was to restrict the set of arguments to those that support L-BFGS. The added class-level documentation should serve the purpose so I revised to **kwargs to avoid duplicates. Thanks for the suggestion!
@@ -31,7 +32,8 @@ | |||
np = cpu_only_import("numpy") | |||
|
|||
|
|||
class LogisticRegression(BaseEstimator, SyncFitMixinLinearModel): | |||
# class LogisticRegression(BaseEstimator, SyncFitMixinLinearModel): | |||
class LogisticRegression(LinearRegression): | |||
def __init__(self, *, client=None, verbose=False, **kwargs): |
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 do think there's a case to be made for specifying defaults in the constructor at this layer, and they should end up getting propagated to the cython class. Another thing we missed in the review of the initial Dask estimator is that this should be documented at the class level. Can you add those docs in this PR too? I think most of the docs can likely be copied from the single gpu LogisticRegression
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.
Good suggestion. I have revised the init function and added class-level documentation.
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.
LGTM! Thanks again @lijinf2!
/merge |
The init arguments are for LBFGS (the only algorithm in the current MNMG LogisticRegression).
The key code changes should be a few lines after PR 5516 for predict gets merged. Key code changes can be reviewed from here