Repository navigation
ENH Add Poisson, Gamma, and Tweedie losses to SGDRegressor for incremental GLM learning - #33813
berasaikat wants to merge 8 commits into
Conversation
…ental GLM learning
|
⏰ This pull request might be automatically closed in two weeks from now. Thank you for your contribution to scikit-learn and for the effort you have put into this PR. This pull request does not yet meet the quality and clarity needed for an effective review. Project maintainers have limited time for code reviews, and our goal is to prioritize well-prepared contributions to keep scikit-learn maintainable. To increase the chance of a productive review, please refer to: How do I improve my issue or pull request? As the author, you are responsible for driving this PR, which entails doing necessary background research as well as presenting its context and your thought process. If you are a new contributor, or do not know how to fulfill these requirements, we recommend that you familiarise yourself with scikit-learn's development conventions via other contribution types (e.g., reviewing PRs) before submitting code. Scikit-learn maintainers cannot provide one-to-one guidance on this PR. However, if you ask focused, well-researched questions, a community member may be willing to help. 💬 If you substantially improve this PR within two weeks, a team member may remove the |
|
All CI check passed. Happy to make any changes if there's feedback. |
|
Thank you for your interest in contributing to scikit-learn, but we cannot accept your contribution as this pull request does not meet our development standards. Following our autoclose policy, we are closing this PR after allowing two weeks time for improvements. Thank you for your understanding. If you think your PR has been closed by mistake, please comment below. |
Description
Closes #29600.
This PR adds three new loss functions to
SGDRegressor—'poisson','gamma', and'tweedie'— enabling online/incremental learning of Generalized Linear Models (GLMs) that are currently only available as batch estimators (PoissonRegressor,GammaRegressor,TweedieRegressor).This is particularly useful for large datasets that don't fit in memory, where
partial_fitis the only viable training strategy.Motivation
PoissonRegressor,GammaRegressor, andTweedieRegressorare widely used in industry for count data, insurance pricing, and other non-negative target problems. However, none of them supportpartial_fit. The only way to do incremental regression in scikit-learn today is viaSGDRegressor, which was missing these loss functions.As noted in #29600, workarounds like learning in log-space with squared loss fail when targets include zeros — Poisson regression handles this gracefully.
Usage Example
Checklist
check_estimator(SGDRegressor())passeslossandpowerparametersdoc/modules/sgd.rstupdated