{"id":13487041,"url":"https://github.com/dswah/pyGAM","last_synced_at":"2025-03-27T21:31:52.452Z","repository":{"id":37390905,"uuid":"79413341","full_name":"dswah/pyGAM","owner":"dswah","description":"[HELP REQUESTED] Generalized Additive Models in Python","archived":false,"fork":false,"pushed_at":"2024-05-06T21:09:08.000Z","size":16321,"stargazers_count":839,"open_issues_count":116,"forks_count":154,"subscribers_count":29,"default_branch":"master","last_synced_at":"2024-05-17T07:02:28.675Z","etag":null,"topics":["data-science","gams","interpretable-machine-learning","machine-learning","python","scientific-computing"],"latest_commit_sha":null,"homepage":"https://pygam.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dswah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-19T03:54:22.000Z","updated_at":"2024-06-18T12:16:03.303Z","dependencies_parsed_at":"2023-02-12T18:31:29.937Z","dependency_job_id":"f738d8b6-4089-4965-ab77-46844d54636d","html_url":"https://github.com/dswah/pyGAM","commit_stats":{"total_commits":609,"total_committers":12,"mean_commits":50.75,"dds":"0.054187192118226646","last_synced_commit":"620958ffc05f64796dab659abaa88cc77d6e918c"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dswah%2FpyGAM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dswah%2FpyGAM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dswah%2FpyGAM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dswah%2FpyGAM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dswah","download_url":"https://codeload.github.com/dswah/pyGAM/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245927315,"owners_count":20695210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-science","gams","interpretable-machine-learning","machine-learning","python","scientific-computing"],"created_at":"2024-07-31T18:00:54.699Z","updated_at":"2025-03-27T21:31:51.412Z","avatar_url":"https://github.com/dswah.png","language":"Python","readme":"![build](https://github.com/dswah/pyGAM/actions/workflows/ci.yml/badge.svg)\n[![Documentation Status](https://readthedocs.org/projects/pygam/badge/?version=latest)](https://pygam.readthedocs.io/en/latest/?badge=latest)\n[![PyPI version](https://badge.fury.io/py/pygam.svg)](https://badge.fury.io/py/pygam)\n[![codecov](https://codecov.io/gh/dswah/pygam/branch/master/graph/badge.svg)](https://codecov.io/gh/dswah/pygam)\n[![python38](https://img.shields.io/badge/python-3.8-blue.svg)](https://badge.fury.io/py/pygam)\n[![python39](https://img.shields.io/badge/python-3.9-blue.svg)](https://badge.fury.io/py/pygam)\n[![python310](https://img.shields.io/badge/python-3.10-blue.svg)](https://badge.fury.io/py/pygam)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1208723.svg)](https://doi.org/10.5281/zenodo.1208723)\n\n\n# pyGAM\nGeneralized Additive Models in Python.\n\n\u003cimg src=imgs/pygam_tensor.png\u003e\n\n## Documentation\n- [Official pyGAM Documentation: Read the Docs](https://pygam.readthedocs.io/en/latest/?badge=latest)  \n- [Building interpretable models with Generalized additive models in Python](https://medium.com/just-another-data-scientist/building-interpretable-models-with-generalized-additive-models-in-python-c4404eaf5515)  \n\u003c!-----\n[pyGAM: Getting started with Generalized Additive Models in Python](https://medium.com/@jpoberhauser/pygam-getting-started-with-generalized-additive-models-in-python-457df5b4705f)\n-----\u003e\n\n## Installation\n```pip install pygam```\n\n### scikit-sparse\nTo speed up optimization on large models with constraints, it helps to have `scikit-sparse` installed because it contains a slightly faster, sparse version of Cholesky factorization. The import from `scikit-sparse` references `nose`, so you'll need that too.\n\nThe easiest way is to use Conda:  \n```conda install -c conda-forge scikit-sparse nose```\n\n[scikit-sparse docs](http://pythonhosted.org/scikit-sparse/overview.html#download)\n\n## Contributing - HELP REQUESTED\nContributions are most welcome!\n\nYou can help pyGAM in many ways including:\n\n- Working on a [known bug](https://github.com/dswah/pyGAM/labels/bug).\n- Trying it out and reporting bugs or what was difficult.\n- Helping improve the documentation.\n- Writing new [distributions](https://github.com/dswah/pyGAM/blob/master/pygam/distributions.py), and [link functions](https://github.com/dswah/pyGAM/blob/master/pygam/links.py).\n- If you need some ideas, please take a look at the [issues](https://github.com/dswah/pyGAM/issues).\n\n\nTo start:\n- **fork the project** and cut a new branch\n- Now **install** the testing **dependencies**\n\n```\nconda install cython\npip install --upgrade pip\npip install poetry\npoetry install --with dev\n```\n\nMake some changes and write a test...\n- **Test** your contribution (eg from the `.../pyGAM`):\n```py.test -s```\n- When you are happy with your changes, make a **pull request** into the `master` branch of the main project.\n\n\n## About\nGeneralized Additive Models (GAMs) are smooth semi-parametric models of the form:\n\n![alt tag](http://latex.codecogs.com/svg.latex?g\\(\\mathbb{E}\\[y|X\\]\\)=\\beta_0+f_1(X_1)+f_2(X_2)+\\dots+f_p(X_p))\n\nwhere `X.T = [X_1, X_2, ..., X_p]` are independent variables, `y` is the dependent variable, and `g()` is the link function that relates our predictor variables to the expected value of the dependent variable.\n\nThe feature functions `f_i()` are built using **penalized B splines**, which allow us to **automatically model non-linear relationships** without having to manually try out many different transformations on each variable.\n\n\u003cimg src=imgs/pygam_basis.png\u003e\n\nGAMs extend generalized linear models by allowing non-linear functions of features while maintaining additivity. Since the model is additive, it is easy to examine the effect of each `X_i` on `Y` individually while holding all other predictors constant.\n\nThe result is a very flexible model, where it is easy to incorporate prior knowledge and control overfitting.\n\n## Citing pyGAM\nPlease consider citing pyGAM if it has helped you in your research or work:\n\nDaniel Servén, \u0026 Charlie Brummitt. (2018, March 27). pyGAM: Generalized Additive Models in Python. Zenodo. [DOI: 10.5281/zenodo.1208723](http://doi.org/10.5281/zenodo.1208723)\n\nBibTex:\n```\n@misc{daniel\\_serven\\_2018_1208723,\n  author       = {Daniel Servén and\n                  Charlie Brummitt},\n  title        = {pyGAM: Generalized Additive Models in Python},\n  month        = mar,\n  year         = 2018,\n  doi          = {10.5281/zenodo.1208723},\n  url          = {https://doi.org/10.5281/zenodo.1208723}\n}\n```\n\n## References\n1. Simon N. Wood, 2006  \nGeneralized Additive Models: an introduction with R\n\n0. Hastie, Tibshirani, Friedman  \nThe Elements of Statistical Learning  \nhttp://statweb.stanford.edu/~tibs/ElemStatLearn/printings/ESLII_print10.pdf  \n\n0. James, Witten, Hastie and Tibshirani  \nAn Introduction to Statistical Learning  \nhttp://www-bcf.usc.edu/~gareth/ISL/ISLR%20Sixth%20Printing.pdf  \n\n0. Paul Eilers \u0026 Brian Marx, 1996\nFlexible Smoothing with B-splines and Penalties\nhttp://www.stat.washington.edu/courses/stat527/s13/readings/EilersMarx_StatSci_1996.pdf\n\n0. Kim Larsen, 2015  \nGAM: The Predictive Modeling Silver Bullet  \nhttp://multithreaded.stitchfix.com/assets/files/gam.pdf  \n\n0. Deva Ramanan, 2008  \nUCI Machine Learning: Notes on IRLS  \nhttp://www.ics.uci.edu/~dramanan/teaching/ics273a_winter08/homework/irls_notes.pdf  \n\n0. Paul Eilers \u0026 Brian Marx, 2015  \nInternational Biometric Society: A Crash Course on P-splines  \nhttp://www.ibschannel2015.nl/project/userfiles/Crash_course_handout.pdf\n\n0. Keiding, Niels, 1991  \nAge-specific incidence and prevalence: a statistical perspective\n\n\n\u003c!---http://www.cs.princeton.edu/courses/archive/fall11/cos323/notes/cos323_f11_lecture09_svd.pdf---\u003e\n\n\u003c!---http://www.stats.uwo.ca/faculty/braun/ss3859/notes/Chapter4/ch4.pdf---\u003e\n\n\u003c!---http://www.stat.berkeley.edu/~census/mlesan.pdf---\u003e\n\n\u003c!---http://web.mit.edu/hyperbook/Patrikalakis-Maekawa-Cho/node17.html---\u003e \u003c!--- this helped me get spline gradients---\u003e\n\n\u003c!---https://scikit-sparse.readthedocs.io/en/latest/overview.html#developers---\u003e\n\n\u003c!---https://vincentarelbundock.github.io/Rdatasets/datasets.html---\u003e \u003c!--- R Datasets!---\u003e\n","funding_links":[],"categories":["The Data Science Toolbox","Machine Learning","Other libraries and tools","Technical Resources","🎲 Statistics \u0026 Probability"],"sub_categories":["General Machine Learning Packages","General Purpose Machine Learning","Mesh tools","Automatic Plotting","Open Source/Access Responsible AI Software Packages","Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdswah%2FpyGAM","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdswah%2FpyGAM","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdswah%2FpyGAM/lists"}