Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #478 +/- ##
==========================================
+ Coverage 76.95% 76.98% +0.02%
==========================================
Files 105 105
Lines 7612 7612
==========================================
+ Hits 5858 5860 +2
+ Misses 1754 1752 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Open
quietlychris
force-pushed
the
fix/glm-fitting
branch
from
December 5, 2026 00:55
c1652c2 to
e9af22d
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On master,
TweedieRegressor::params().fit(..)(Poisson, log link: the defaults)never returns on 10 000 samples, and on smaller data it stops early with wrong
coefficients. Two bugs:
unit_deviancecomputed2 y ln(y/μ) - y + μinstead of2 (y ln(y/μ) - y + μ), so the cost disagreed with its gradient and L-BFGS stoppedwith a non-zero gradient (on exact data, intercept 0.31 instead of 0.2).
with n. L-BFGS's first step (along the gradient, no curvature yet) overflowed
exp,the cost became NaN, and the More–Thuente line search, which has no iteration
limit, kept extrapolating. The objective and gradient are now divided by n: same
minimum, same meaning of
alpha, but the gradient tolerance now applies per sample.Tests
test_gradient_matches_cost: the gradient matches finite differences of the costfor powers 0, 1, 1.5, 2, 3 (only Poisson failed before).
test_glm_poisson_many_samples: 2000 samples, recovers the exact coefficients;hangs on master.
Against scikit-learn
n = 10 000, 8 features, noisy data,
alpha= 1 in linfa and 1/n in scikit-learn 1.9.1: