Skip to content

Raise error logreg liblinear - #31888

Merged
ogrisel merged 13 commits into
scikit-learn:mainfrom
snath-xoc:raise_error_logreg_liblinear
Nov 7, 2025
Merged

ogrisel merged 13 commits into
scikit-learn:mainfrom
snath-xoc:raise_error_logreg_liblinear

Conversation

@snath-xoc

@snath-xoc snath-xoc commented Aug 7, 2025 •

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Fixes #7486

What does this implement/fix? Explain your changes.

LogisticRegression freezes when using the liblinear solver with X containing large values>1e30. A ValueError is now raised if X contains a maximum value >1e30 with accompanying tests

Any other comments?

@antoinebaker @yl565 @agramfort @ogrisel

@github-actions

github-actions Bot commented Aug 7, 2025 •

Copy link
Copy Markdown

✔️ Linting Passed

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

Generated for commit: df7009f. Link to the linter CI: here

@snath-xoc

Copy link
Copy Markdown
Contributor Author

FYI @antoinebaker

@antoinebaker antoinebaker 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.

Thanks for the PR @snath-xoc ! Here a couple nitpicks.

Maybe we should add a changelog entry too ? (as we are raising a new error).

Comment thread sklearn/linear_model/_logistic.py Resolved

@antoinebaker antoinebaker 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.

Thanks again @snath-xoc, LGTM !

@snath-xoc

Copy link
Copy Markdown
Contributor Author

@ogrisel or @adrinjalali perhaps we can review this and merge soon?

@ogrisel ogrisel 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.

This might help prevent denial-of-service attacks.

@ogrisel
ogrisel merged commit d539675 into scikit-learn:main Nov 7, 2025
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.

LogisticRegression freezed when X containing large number

3 participants