You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] TweedieGLM ignores drop and drop_valuation unless sample_weight is passed #1619
TweedieGLM accepts drop and drop_valuation, but on main they change nothing unless sample_weight is also passed. The fit uses no weights when sample_weight is None (glm.py L217–L220), and DevelopmentML sets sample_weights = {} when weighted_step is None (learning.py L341–L342), so the weights that TriangleWeight builds from the exclusions are never applied. No warning is raised.
Observed: all three are [3.491, 1.7474, 1.4574, 1.1739].
With sample_weight set to a triangle of ones (genins * 0 + 1), the same exclusions do take effect: drop_valuation="2005" gives [3.5057, 1.7861, 1.4546, 1.1711].
These outputs are from ee2c24d; the commits since, up to 1457b76, don't touch chainladder/development or chainladder/core.
Expected
Either the exclusions apply without sample_weight (as they do in Development and BarnettZehnwirth), or fit raises or warns that they are ignored.
Notes
A search of open and closed issues and PRs for "TweedieGLM drop", "TweedieGLM drop_valuation", "TweedieGLM sample_weight" and "weighted_step" found no report. [BUG] TweedieGLM never passes alpha to TweedieRegressor #1584 is a separate TweedieGLM bug (alpha is never passed to TweedieRegressor).
BarnettZehnwirth applies TriangleWeight to the cell triangle, so it drops the named valuation's cells, while Development drops link ratios keyed by their starting valuation (cl.Development(), drop_valuation not behaving as expected #168). This issue doesn't propose changing either keying.
Not checked: DevelopmentML used directly with a pipeline and no weighted_step.
(This issue was written with Árbol, an AI assistant, under my direction.)
Reproduced on main at c113fd9: drop and drop_valuation change nothing in TweedieGLM.fit unless sample_weight is also passed (all three LDFs come out identical). The weights built from the exclusions in DevelopmentML._prep_w_ml are only passed to the estimator when weighted_step is set, which TweedieGLM only does when sample_weight is given.
I plan to fix it in chainladder/development/glm.py so the exclusion weights are applied even when sample_weight is None (matching BarnettZehnwirth, which always passes weighted_step="model"), and add a regression test in chainladder/development/tests/test_glm.py.
Activity
henrydingliu commentedon Nov 14, 2026
oops, i think i'm personally responsible for this.
Huyvux12 commentedon Nov 16, 2026
Reproduced on main at c113fd9:
dropanddrop_valuationchange nothing inTweedieGLM.fitunlesssample_weightis also passed (all three LDFs come out identical). The weights built from the exclusions inDevelopmentML._prep_w_mlare only passed to the estimator whenweighted_stepis set, whichTweedieGLMonly does whensample_weightis given.I plan to fix it in
chainladder/development/glm.pyso the exclusion weights are applied even whensample_weightis None (matchingBarnettZehnwirth, which always passesweighted_step="model"), and add a regression test inchainladder/development/tests/test_glm.py.