-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MRG] Added FutureWarning in sgd models for tol parameter #12399
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
[MRG] Added FutureWarning in sgd models for tol parameter #12399
Conversation
if tol is None while max_iter is set
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.
There perhaps should be a note in the docs for max_iter too. Thanks
warnings.warn( | ||
"max_iter and tol parameters have been added in %s in " | ||
"0.19. If max_iter is set but tol is left unset, the " | ||
"default value for tol in 0.19 and 0.20 will be None " |
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 think the semantics of None here are unclear. Is None equivalent to 0?
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.
"is 0"?
"default value for tol in 0.19 and 0.20 will be None " | ||
"but will change in 0.21 to 1e-3. Specify tol to " | ||
"silence this warning." % type(self).__name__, | ||
ChangedBehaviorWarning) |
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 think this is technically meant to be a FutureWarning
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.
Right,ow it should be a FutureWarning since we didn't change yet.
all these warnings should be captured in the tests. You will see that tests will fail once you change it to |
(I wouldn't explicitly set tol) |
Not sure what you mean, where in the docs and about what? |
@@ -31,6 +31,11 @@ | |||
from sklearn.model_selection import RandomizedSearchCV | |||
|
|||
|
|||
# 0.23. warning about tol not having its correct default value. | |||
pytestmark = pytest.mark.filterwarnings( | |||
"ignore:max_iter and tol parameters have been") |
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.
There was so many warnings in this file that I globally ignored them, for the whole module.
By a note in the docs I meant that the max_iter description should say that tol should be set at the same time for forwards compatibility |
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.
You can ignore with a module level fixture, rather than touching each test
I've done this for one of the modules that had tons of failing tests but not for the others, because it doesn't seem to be a common practice (in scikit-learn). But I find it better myself, yeah. Should I use the module-level ignore instead? |
But this is only true up to 0.21 right? |
Can you add mention of the changing default value to whatsnew in the change model section? |
though actually nevermind, I'll do that for 0.21, not here. |
…rn#12399) * Added ChangedBehaviorWarning in sgd models if tol is None while max_iter is set * Changed to FutureWarning and clarified None meaning * Ignored warningin tests * Ignore warnings in tests, round 2
…rn#12399) * Added ChangedBehaviorWarning in sgd models if tol is None while max_iter is set * Changed to FutureWarning and clarified None meaning * Ignored warningin tests * Ignore warnings in tests, round 2
…rn#12399) * Added ChangedBehaviorWarning in sgd models if tol is None while max_iter is set * Changed to FutureWarning and clarified None meaning * Ignored warningin tests * Ignore warnings in tests, round 2
…rn#12399) * Added ChangedBehaviorWarning in sgd models if tol is None while max_iter is set * Changed to FutureWarning and clarified None meaning * Ignored warningin tests * Ignore warnings in tests, round 2
…ikit-learn#12399)" This reverts commit e26d4d9.
…ikit-learn#12399)" This reverts commit e26d4d9.
…rn#12399) * Added ChangedBehaviorWarning in sgd models if tol is None while max_iter is set * Changed to FutureWarning and clarified None meaning * Ignored warningin tests * Ignore warnings in tests, round 2
Reference Issues/PRs
Addresses #12239 (comment)
What does this implement/fix? Explain your changes.
Added
FutureWarning
in sgd models iftol
isNone
whilemax_iter
is set.Any other comments?