19
$\begingroup$

I know that R has gam and mgcv libraries for generalized additive models. But I am having difficulty finding their counterparts in the Python ecosystem (statsmodels only has prototype in the sandbox). Is anyone aware of existing python libraries? Who knows this might be a good project to develop/contribute to scikit-learn if not.

$\endgroup$
3
  • $\begingroup$ statsmodels had a GSOC project for GAM and penalized splines github.com/statsmodels/statsmodels/pull/2744 $\endgroup$
    – Josef
    Commented Mar 5, 2016 at 3:13
  • $\begingroup$ @user333700 Interesting. Is this distinct from the scikit-learn GSOC '15 project described here? : github.com/scikit-learn/scikit-learn/wiki/… $\endgroup$
    – Pylander
    Commented Mar 6, 2016 at 21:39
  • $\begingroup$ It's completely independent of scikit-learn. In the first round, as in the PR, only GLM will be supported. scikit-learn didn't have a GSOC project for it, AFAIK. $\endgroup$
    – Josef
    Commented Mar 6, 2016 at 22:42

3 Answers 3

28
$\begingroup$

I've written a Python implementation of GAMs using penalized B-splines.

check it out here: https://github.com/dswah/pyGAM

I've included lots of link functions, distributions and features.

$\endgroup$
2
$\begingroup$

Another option for quick experimentation with GAM models is the package https://github.com/malmgrek/gammy.

The emphasis is on Bayesian modeling of the GAM coefficients as well as easy extensibility on custom basis functions. Currently e.g. Gaussian processes, B-splines, as well as different trivial constructs.

$\endgroup$
2
$\begingroup$

Another recent development are neural additive models which apply the GAM approach to a deep learning architecture:

https://arxiv.org/abs/2004.13912

https://github.com/nickfrosst/neural_additive_models

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.