-
-
Notifications
You must be signed in to change notification settings - Fork 26k
[MRG+1]: avoid FutureWarning in BaseSGD.set_params #9802
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
@@ -50,7 +50,7 @@ def __init__(self, loss, penalty='l2', alpha=0.0001, C=1.0, | |||
l1_ratio=0.15, fit_intercept=True, max_iter=None, tol=None, | |||
shuffle=True, verbose=0, epsilon=0.1, random_state=None, | |||
learning_rate="optimal", eta0=0.0, power_t=0.5, | |||
warm_start=False, average=False, n_iter=None): | |||
warm_start=False, average=False, n_iter=None, set_future_warning=True): |
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 don't think we want this as a constructor parameter. It should be a parameter to _validate_params
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.
Thanks. I'll modify the code.
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 about right. Can you show the output of cross validation over an SGDRegressor() before and after this change please?
Before: After: |
Script |
@jnothman I've included the CV output. Can you have a look at it? |
At master I get:
which is what I was expecting. In your branch, I get:
I now realise that this is identical because |
Should I close the PR or add set_max_iter to set_params instead? |
whichever you rather
|
I've added set_max_iter as a param for set_param. |
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. I assume this is MRG now...
(We could require a test, but I'm not sure it's worth much...) |
But just to be sure, check the output when doing |
Output- Code- |
and this is different to master?
|
No, it isn't. Is it possible that something else is triggering the warnings? |
It is for me! At master I get 62 warnings; at this branch I get 31. It's definitely an improvement! |
Merging, thanks. |
Reference Issue
Fixes #9752
What does this implement/fix? Explain your changes.
Adds a set_future_warning flag in BaseSGD to help avoid FutureWarnings
in uses of init or set_params.