sktime / skpro

A unified framework for tabular probabilistic regression, time-to-event prediction, and probability distributions in python
https://skpro.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
250 stars 46 forks source link

[ENH] Multiple link function support for GLMs #383

Closed ShreeshaM07 closed 5 months ago

ShreeshaM07 commented 6 months ago

Is your feature request related to a problem? Please describe.

The existing GLMRegressor supports only the Gaussian family and in that specifically only the Identity link function. There are many other family like Poisson, Binomial, Negative Binomial , Gamma that can be implemented and each of these having a set of safe link functions of their own. So the idea would be to support these different family and their link function in order to make the GLMRegressor of more broader use.

Describe the solution you'd like

Currently the _glm.py in skpro is only using the Gaussian family and its default link function interfaced from statsmodels. However we can extend this to support multiple link functions and different families by either adding an adapter for this to convert the available families in statsmodels to skpro BaseDistributions available.

ShreeshaM07 commented 6 months ago

I was thinking of extending the previously written code for GLMRegressor by adding parameters family and link where family will have the type of distribution like Normal,Poisson or Gamma and the link will be the various available links for the respective family. They will be passed as strings and then converted to the object instance internally maybe with an adapter class.

FYI @fkiraly, @julian-fong .

julian-fong commented 6 months ago

Sounds good to me! Actually this is potentially a dup of #230. Some of the ideas there may coincide with this issue

fkiraly commented 6 months ago

Actually this is potentially a dup of https://github.com/sktime/skpro/issues/230. Some of the ideas there may coincide with this issue

I'd say, subset - #230 is more of an umbrella issue. I will add a link to this issue there.