Welcome to pyGAM’s documentation!#
Getting Started#
pyGAM is a package for building Generalized Additive Models in Python, with an emphasis on modularity and performance. The API will be immediately familiar to anyone with experience of scikit-learn or scipy.
If you’re new to pyGAM, take a Tour of pyGAM for an introduction to the package.
Installation#
Pip#
pyGAM is on pypi, and can be installed using pip:
pip install pygam
Conda#
Or via conda-forge, however this is typically less up-to-date:
conda install -c conda-forge pyGAM
Bleeding Edge#
You can install the bleeding edge from github using pip.
First clone the repo, cd into the main directory and do:
pip install . # for an unstable "latest" dev version
# or
pip install -e . # for an editable developer/contributor version
Acceleration#
Most of pyGAM’s computations are linear algebra operations.
To speed up optimization on large models with constraints, it helps to have intel MKL installed.
It is currently a bit tricky to install both NumPy and SciPy linked to the MKL routines with Conda because you have to be careful with which channel you are using. Pip’s NumPy-MKL is outdated.
An alternative is to use a third-party build like https://urob.github.io/numpy-mkl:
pip install numpy scipy --extra-index-url https://urob.github.io/numpy-mkl
Dependencies#
pyGAM is tested on Python 3.10+ and depends on NumPy, SciPy, and progressbar2.
In addition to the above dependencies, the pygam.datasets submodule relies on Pandas.
See pyproject.toml for detailed version information).
Citing pyGAM#
Servén D., Brummitt C. (2018). pyGAM: Generalized Additive Models in Python. Zenodo. DOI: 10.5281/zenodo.1208723
Contact#
To report an issue with pyGAM please use the issue tracker.