Skip to content

TST cleanup of tests for LogisticRegression - #32759

Merged
OmarManzoor merged 10 commits into
scikit-learn:mainfrom
lorentzenchr:tst_logreg_cleanup
Jan 5, 2026
Merged

OmarManzoor merged 10 commits into
scikit-learn:mainfrom
lorentzenchr:tst_logreg_cleanup

Conversation

@lorentzenchr

Copy link
Copy Markdown
Member

Reference Issues/PRs

None

What does this implement/fix? Explain your changes.

Over time, test_logistic.py has grown to more than 2600 lines of code with duplicate tests.
This PR reorders some of the tests and removes some of the duplicate ones.

Any other comments?

In case of doubt, follow the single commits. I tried to keep them very clean.

@github-actions

github-actions Bot commented Nov 21, 2025 •

Copy link
Copy Markdown

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 697a16a. Link to the linter CI: here

@lorentzenchr

Copy link
Copy Markdown
Member Author

@OmarManzoor @virchan You might be interested in this one.

@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 for the cleanup @lorentzenchr

@OmarManzoor OmarManzoor added the Waiting for Second Reviewer First reviewer is done, need a second one! label Jan 5, 2026

@virchan virchan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thanks, @lorentzenchr!

@OmarManzoor, could we merge this?

@lesteve

lesteve commented Jan 7, 2026

Copy link
Copy Markdown
Member

Looks like this is causing the CI to fail for some random seeds, see automatically opened issues #32710 #33016 #33017 #33018

I can reproduce the test_logistic_cv_sparse one locally with

SKLEARN_TESTS_GLOBAL_RANDOM_SEED=all pytest sklearn/linear_model/tests/test_logistic.py -k 'test_logistic_cv_sparse and sag and csr'

I am not able to reproduce the test_logreg_l1 one locally #32430 but you can test it in the CI following #28959

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants