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

Skip to content

ENH add newton-cg solver to GLM like PoissonRegressor - #33759

Merged
OmarManzoor merged 7 commits into
scikit-learn:mainfrom
lorentzenchr:newton_cg_glm
Jun 16, 2026
Merged

ENH add newton-cg solver to GLM like PoissonRegressor#33759
OmarManzoor merged 7 commits into
scikit-learn:mainfrom
lorentzenchr:newton_cg_glm

Conversation

@lorentzenchr

@lorentzenchr lorentzenchr commented Apr 15, 2026

Copy link
Copy Markdown
Member

Reference Issues/PRs

Solves #16635.

What does this implement/fix? Explain your changes.

This PR add the solver="newton-cg" to

  • PoissonRegressor
  • GammaRegressor
  • TweedieRegressor

AI usage disclosure

None

Any other comments?

This is a good solver when X is sparse or when X has many features.

Newton-CG could turn out to be very easy to make Array API compliant, see #33765.

@lorentzenchr lorentzenchr linked an issue Apr 15, 2026 that may be closed by this pull request
@lorentzenchr

Copy link
Copy Markdown
Member Author

@virchan @OmarManzoor This might interest you.

@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! Just some minor issue with the version number. Thanks, @lorentzenchr!

Comment thread sklearn/linear_model/_glm/glm.py Outdated
Comment thread sklearn/linear_model/_glm/glm.py Outdated
Comment thread sklearn/linear_model/_glm/glm.py Outdated
Comment thread sklearn/linear_model/_glm/glm.py Outdated

@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

Only suggested a few doc improvements

Comment thread sklearn/linear_model/_glm/tests/test_glm.py Outdated
Comment thread sklearn/linear_model/_glm/glm.py Outdated
Comment thread sklearn/linear_model/_glm/glm.py Outdated
Comment thread sklearn/linear_model/_glm/glm.py Outdated
Comment thread sklearn/linear_model/_glm/glm.py Outdated
@github-actions github-actions Bot added the CI:Linter failure The linter CI is failing on this PR label Jun 15, 2026
@github-actions github-actions Bot removed the CI:Linter failure The linter CI is failing on this PR label Jun 16, 2026
@OmarManzoor
OmarManzoor enabled auto-merge (squash) June 16, 2026 11:52
@OmarManzoor
OmarManzoor merged commit f22caea into scikit-learn:main Jun 16, 2026
36 checks passed
@lorentzenchr

Copy link
Copy Markdown
Member Author

@virchan @OmarManzoor It is a real pleasure to work with you both!

@OmarManzoor

Copy link
Copy Markdown
Contributor

@virchan @OmarManzoor It is a real pleasure to work with you both!

Thank you. Your PRs are really good!

@lorentzenchr
lorentzenchr deleted the newton_cg_glm branch June 16, 2026 14:59
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.

Add newton_cg solver to TweedieRegression

3 participants