-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
Change assert from sklearn to pytest style in module linear_model/tests #19565
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
Change assert from sklearn to pytest style in module linear_model/tests #19565
Conversation
8a85f7b
to
3be8587
Compare
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 very much for the contribution!
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. We can merge with or without my one suggestion.
@shivamgargsya Thanks.
warning_messages = { | ||
'newton-cg': ( | ||
"newton-cg failed to converge. Increase the" | ||
" number of iterations." | ||
), | ||
'liblinear': ( | ||
"Liblinear failed to converge, increase the" | ||
" number of iterations." | ||
), | ||
'sag': ( | ||
"The max_iter was reached which means the" | ||
" coef_ did not converge" | ||
), | ||
'saga': ( | ||
"The max_iter was reached which means the" | ||
" coef_ did not converge" | ||
), | ||
'lbfgs': ( | ||
r"lbfgs failed to converge .*[\n]*.*[\n]*" | ||
r"Increase the number of iterations.*" | ||
r"or scale the data.*[\n]*.*[\n]*" | ||
r"Please also refer to the documentation " | ||
r"for alternative solver options.*[\n]*.*" | ||
) | ||
} |
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 prefer to @pytest.mark.parametrize
this test with max_iter
, multi_class
and [solver, message]
.
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 directly pushed the requested changes. I'll merge on green. Thanks @shivamgargsya !
Reference Issues/PRs
Part of #19414 for linear_model/tests
What does this implement/fix? Explain your changes.
Removed use of assert_warns, assert_warns_message in linear_model/tests package
Any other comments?
The fix is part of complete fix for issue #19414