Skip to content

FIX Don't raise ConvergenceWarning when a callback stops LogisticRegression - #35448

Merged
lorentzenchr merged 1 commit into
scikit-learn:mainfrom
betatim:callback-early-stopping-warning
Nov 19, 2026
Merged

lorentzenchr merged 1 commit into
scikit-learn:mainfrom
betatim:callback-early-stopping-warning

Conversation

@betatim

@betatim betatim commented Nov 18, 2026

Copy link
Copy Markdown
Member

Reference Issues/PRs

Follow up to #35334

What does this implement/fix? Explain your changes.

When a callback stops an lbfgs fit early, that was the user's choice, not a failure to converge. Only warn when max_iter is reached without a callback asking to stop.

AI usage disclosure

I used AI assistance for:

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

cc @lorentzenchr @jeremiedbb @ogrisel

When a callback stops an lbfgs fit early, that was the user's choice, not a
failure to converge. Only warn when max_iter is reached without a callback
asking to stop.

@lorentzenchr lorentzenchr 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 fixing this one, too.

@lorentzenchr lorentzenchr changed the title Don't raise ConvergenceWarning when a callback stops LogisticRegression FIX Don't raise ConvergenceWarning when a callback stops LogisticRegression Nov 19, 2026
@lorentzenchr
lorentzenchr merged commit 6736ecd into scikit-learn:main Nov 19, 2026
46 checks passed
@betatim
betatim deleted the callback-early-stopping-warning branch November 19, 2026 07:10
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.

2 participants