Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MNT don't use random_state in LogisticRegression unless it has an effect - #34287

Merged
OmarManzoor merged 3 commits into
scikit-learn:mainfrom
lorentzenchr:lr_no_random_state
Jun 17, 2026
Merged

MNT don't use random_state in LogisticRegression unless it has an effect#34287
OmarManzoor merged 3 commits into
scikit-learn:mainfrom
lorentzenchr:lr_no_random_state

Conversation

@lorentzenchr

Copy link
Copy Markdown
Member

Reference Issues/PRs

Fixes #34286.

What does this implement/fix? Explain your changes.

Removes random_state=.. in LogisticRegression where it has no effect.

First time contributor introduction

AI usage disclosure

None

Any other comments?

@AnneBeyer AnneBeyer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @lorentzenchr! I agree that it does not make sense to specify random_state in the tests and examples where it is not actually used.

Comment thread sklearn/multioutput.py Outdated
Comment thread sklearn/utils/_repr_html/tests/test_estimator.py Outdated
@AnneBeyer

Copy link
Copy Markdown
Contributor

The linting problems should be fixed via #34300 now, merging main should make the tests pass again.

@OmarManzoor OmarManzoor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you @lorentzenchr

@OmarManzoor
OmarManzoor merged commit 679b8a5 into scikit-learn:main Jun 17, 2026
38 checks passed
@lorentzenchr
lorentzenchr deleted the lr_no_random_state branch June 17, 2026 19:23
prady0t pushed a commit to prady0t/scikit-learn that referenced this pull request Sep 2, 2026
@jeremiedbb jeremiedbb mentioned this pull request Sep 8, 2026
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stopp setting random_state in LogisticRegression unless it has an effect

3 participants