glum/tweedie-invalid-power
| Pack | Severity | Fix | Versions |
|---|---|---|---|
| glum | error | none, edit by hand | All versions |
No exponential dispersion model exists in the Tweedie family for 0 < power < 1, so TweedieDistribution and TweedieLink raise ValueError immediately.
dist = TweedieDistribution(power=0.5)dist = TweedieDistribution(power=1.5)What the rule reports
Section titled “What the rule reports”Calls to TweedieDistribution or TweedieLink with a literal power strictly between 0 and 1.
How to fix it
Section titled “How to fix it”Choose a valid Tweedie variance power: 0 (Normal), 1 (Poisson), (1, 2) (compound Poisson-Gamma), 2 (Gamma), or 3 (Inverse Gaussian).
Diagnostic message
Section titled “Diagnostic message”No Tweedie distribution exists for 0 < power < 1, and glum raises ValueError. Use power <= 0 (normal is 0), power == 1 (Poisson), 1 < power < 2 (compound Poisson-Gamma), or power >= 2.See all rules in the glum pack.