glum
glum copied to clipboard
Restructure distributions
This PR restructures the distributions to avoid diamond inheritance -- i.e. the gamma, inverse Gaussian, normal and Poisson distributions no longer inherit from the Tweedie distribution. Because it is often convenient to test whether a distribution belongs to the Tweedie family, I added a to_tweedie method to the base class, which allows users to recover the Tweedie representation of a family if it exists. (I added an equivalent method to Link.)
Because it is a breaking change, the base branch is glum_v3.
Some free riders:
-
ExponentialDispersionModel.in_y_rangehas been cleaned up. - The documentation of the different distributions has been cleaned up and simplified.
- Excessively restrictive type hints have been removed. A few new hints have been added.
- Cython functions for the inverse Gaussian distribution have been added.
- The parsing of Tweedie links in
get_familyhas been aligned onget_family.