-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
TST use global_random_seed in sklearn/linear_model/tests/test_logistic.py
#31362
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
base: main
Are you sure you want to change the base?
Conversation
@DeaMariaLeon Please note that |
Thank you so much @lorentzenchr! |
@@ -254,13 +253,16 @@ def test_elasticnet_l1_ratio_err_helpful(LR): | |||
# TODO(1.8): remove whole test with deprecation of multi_class | |||
@pytest.mark.filterwarnings("ignore:.*'multi_class' was deprecated.*:FutureWarning") | |||
@pytest.mark.parametrize("solver", ["lbfgs", "newton-cg", "sag", "saga"]) | |||
def test_multinomial_binary(solver): | |||
def test_multinomial_binary(global_random_seed, solver): |
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.
Maybe this test doesn't need global_random_seed as it will be removed
|
||
params = dict(fit_intercept=False, random_state=42) | ||
params = dict(C=0.1, fit_intercept=False, random_state=global_random_seed) |
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 it better to skip the solvers that don't use random_state, but make the code a bit more complex with the skip? or to add global_random_seed
to all the solvers but make the test take longer?
Reference Issues/PRs
Towards #22827
What does this implement/fix? Explain your changes.
Any other comments?