{"id":19669171,"url":"https://github.com/tommyod/generalized-additive-models","last_synced_at":"2025-04-29T00:30:56.395Z","repository":{"id":169468120,"uuid":"597699567","full_name":"tommyod/generalized-additive-models","owner":"tommyod","description":"Generalized Additive Models in Python.","archived":false,"fork":false,"pushed_at":"2024-11-09T13:30:35.000Z","size":564,"stargazers_count":17,"open_issues_count":13,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-09T14:28:41.846Z","etag":null,"topics":["data-science","gam","glm","statistical-inference","statistical-models","statistics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tommyod.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2023-02-05T11:22:17.000Z","updated_at":"2024-10-09T05:58:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"b07138cc-25be-430b-a43a-960ea2eecdbe","html_url":"https://github.com/tommyod/generalized-additive-models","commit_stats":{"total_commits":23,"total_committers":2,"mean_commits":11.5,"dds":0.04347826086956519,"last_synced_commit":"cb0015fce40a29ed77f60fec8d2c4de953d2ca80"},"previous_names":["tommyod/generalized-additive-models"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommyod%2Fgeneralized-additive-models","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommyod%2Fgeneralized-additive-models/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommyod%2Fgeneralized-additive-models/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommyod%2Fgeneralized-additive-models/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tommyod","download_url":"https://codeload.github.com/tommyod/generalized-additive-models/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223841212,"owners_count":17212283,"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","gam","glm","statistical-inference","statistical-models","statistics"],"created_at":"2024-11-11T16:39:15.676Z","updated_at":"2024-11-11T16:39:16.656Z","avatar_url":"https://github.com/tommyod.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. -*- mode: rst -*-\n\n|Actions|_ |PythonVersion|_ |PyPi|_ |Black|_ |ReadtheDocs|_\n\n.. |Actions| image:: https://github.com/tommyod/generalized-additive-models/workflows/Python%20CI/badge.svg?branch=main\n.. _Actions: https://github.com/tommyod/generalized-additive-models/actions/workflows/build.yml?query=branch%3Amain\n\n.. |PythonVersion| image:: https://img.shields.io/badge/python-3.9%20|%203.10%20|%203.11|%203.12%20-blue\n.. _PythonVersion: https://pypi.org/project/generalized-additive-models\n\n.. |PyPi| image:: https://img.shields.io/pypi/v/generalized-additive-models\n.. _PyPi: https://pypi.org/project/generalized-additive-models\n\n.. |Black| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n.. _Black: https://github.com/psf/black\n\n.. |Downloads| image:: https://pepy.tech/badge/generalized-additive-models\n.. _Downloads: https://pepy.tech/project/generalized-additive-models\n\n.. |ReadtheDocs| image:: https://readthedocs.org/projects/generalized-additive-models/badge/\n.. _ReadtheDocs: https://generalized-additive-models.readthedocs.io/en/latest/\n\n\ngeneralized-additive-models\n===========================\n\nGeneralized Additive Models (GAMs) in Python.\n\nAbout\n-----\n\nGAMs are uniquely placed on the interpretability vs. precitive power continuum.\nIn many applications they perform almost as well as more complex models, but are extremely interpretable.\n\n- GAMs extend linear regression by allowing non-linear relationships between features and the target.\n- The model is still additive, but link functions and multivariate splines facilitate a broad class of models.\n- While GAMs are likely outperformed by non-additive models (e.g. boosted trees), GAMs are extremely interpretable.\n\nRead more about GAMs:\n\n- `Predictive Modeling Silver Bullet \u003chttps://web.archive.org/web/20210812020305/https://multithreaded.stitchfix.com/assets/files/gam.pdf\u003e`_\n- `Generalized Additive Models: An Introduction with R \u003chttps://www.amazon.com/Generalized-Additive-Models-Introduction-Statistical/dp/1498728332\u003e`_\n\nA GAM is a statistical model in which the target variable depends on unknown smooth functions of the features, \nand interest focuses on inference about these smooth functions.\n  \nAn exponential family distribution is specified for the target Y (.e.g Normal, Binomial or Poisson) \nalong with a link function g (for example the identity or log functions) relating the \nexpected value of Y to the predictor variables.\n\n\nInstallation\n------------\n\nInstall using pip::\n\n    pip install generalized-additive-models\n\n\nExample\n-------\n\n.. code-block:: python\n\n    from sklearn.datasets import load_diabetes\n    from sklearn.model_selection import cross_val_score\n    from generalized_additive_models import GAM, Spline, Categorical\n        \n    # Load data\n    data = load_diabetes(as_frame=True)\n    df, y = data.data, data.target\n    \n    # Create model\n    terms = Spline(\"bp\") + Spline(\"bmi\", constraint=\"increasing\") + Categorical(\"sex\")\n    gam = GAM(terms)\n    \n    # Cross validate\n    scores = cross_val_score(gam, df, y, scoring=\"r2\")\n    print(scores) # array([0.26, 0.4 , 0.41, 0.35, 0.42])\n    \n\nGo to `Read the Docs \u003chttps://generalized-additive-models.readthedocs.io/en/latest/\u003e`_ to see full documentation.\n\nContributing and development\n----------------------------\n\nContributions are very welcome.\nYou can correct spelling mistakes, write documentation, clean up code, implement new features, etc.\n\nSome guidelines for development:\n\n- Code must comply with the standard. See the GitHub action pipeline for more information.\n- If possible, use existing algorithms from `numpy`, `scipy` and `scikit-learn`.\n- Write tests, especically regression tests if a bug is fixed.\n- Take backward compatibility seriously. API changes require good reason.\n\nInstallation for local development::\n\n    pip install -e '.[dev,lint,doc]'\n    \nCreate documentation locally::\n\n    sudo apt install pandoc\n    sphinx-build docs _built_docs/html -W -a -E --keep-going\n    sphinx-autobuild docs _built_docs/html -v -j \"auto\" --watch generalized_additive_models\n    \nOnce the `version` has been incremented, the commit must be tagged and pushed in order to publish to PyPi::\n\n    git tag -a v0.1.0 -m \"Version 0.1.0\" b22724c\n    git push origin v0.1.0\n\nCiting\n------\n\nTODO\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommyod%2Fgeneralized-additive-models","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftommyod%2Fgeneralized-additive-models","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommyod%2Fgeneralized-additive-models/lists"}