-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MRG] DOC Fix warnings in examples #12654
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
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.
Very nice! A few comments are below, overall LGTM.
In general, I don't think it's such a big issue to have e.g. a ConvergenceWarning
in an example if a few are remaining. That's a real use case, and it's better to show that to user rather than hide it (just for the sake of having no warnings in sphinx log).
@@ -90,7 +90,7 @@ def fit_and_score(estimator, max_iter, X_train, X_test, y_train, y_test): | |||
# Define the estimators to compare | |||
estimator_dict = { | |||
'No stopping criterion': | |||
linear_model.SGDClassifier(tol=None, n_iter_no_change=3), | |||
linear_model.SGDClassifier(tol=-np.inf, n_iter_no_change=3), |
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.
Why not None
(or just remove it altogether since it's the default)?
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.
Had it -inf
cause that's the default now, but changed to 1e-3
which is the new default. Not passing it causes a warning.
|
||
print(__doc__) | ||
# Author: Arthur Mensch | ||
|
||
t0 = time.clock() | ||
warnings.filterwarnings("ignore", category=ConvergenceWarning, | ||
module="sklearn") |
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 would argue that it's better to show the convergence warning to user rather than hide it.
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.
My idea here is to be explicit in the code that we know the model is not converging, but we know what we're doing. I'd say if such a usecase happens in production, the user should explicitly have this in the code.
LGTM, though tests are failing. |
yep, the tests fail due to #12906, they used to pass though. |
Tests finally pass, [hopefully final] reviews welcome :) |
Thanks @adrinjalali |
Hmm... this has broken Circle with the following TeX error:
Any idea what the cause is, or does it need investigation? |
Ah, I see. File name changed. |
yep |
Fixing in 486f8fc |
Fixe or suppresses many warnings in examples, including matplotlib complaining about the non-gui backend.
Fixe or suppresses many warnings in examples, including matplotlib complaining about the non-gui backend.
This reverts commit 492d014.
This reverts commit 492d014.
Fixe or suppresses many warnings in examples, including matplotlib complaining about the non-gui backend.
Fixe or suppresses many warnings in examples, including matplotlib complaining about the non-gui backend.