{"id":41234331,"url":"https://github.com/AlexanderFabisch/gmr","last_synced_at":"2026-02-01T10:00:42.894Z","repository":{"id":14408607,"uuid":"17119390","full_name":"AlexanderFabisch/gmr","owner":"AlexanderFabisch","description":"Gaussian Mixture Regression","archived":false,"fork":false,"pushed_at":"2026-01-12T08:05:44.000Z","size":2473,"stargazers_count":199,"open_issues_count":5,"forks_count":52,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-01-29T13:16:54.494Z","etag":null,"topics":["gaussian-mixture-models","machine-learning","python","regression"],"latest_commit_sha":null,"homepage":"https://alexanderfabisch.github.io/gmr/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"rishabhgulati/Microsoft-Hackfest","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexanderFabisch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-02-23T23:07:11.000Z","updated_at":"2026-01-14T17:16:57.000Z","dependencies_parsed_at":"2024-06-19T01:37:04.793Z","dependency_job_id":"99be36d5-f969-4c4e-9648-bdd410c07e7f","html_url":"https://github.com/AlexanderFabisch/gmr","commit_stats":{"total_commits":236,"total_committers":7,"mean_commits":"33.714285714285715","dds":0.3771186440677966,"last_synced_commit":"0c077bae6bf620160c01600817f2e88977e8d811"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/AlexanderFabisch/gmr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderFabisch%2Fgmr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderFabisch%2Fgmr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderFabisch%2Fgmr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderFabisch%2Fgmr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexanderFabisch","download_url":"https://codeload.github.com/AlexanderFabisch/gmr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderFabisch%2Fgmr/sbom","scorecard":{"id":11273,"data":{"date":"2025-08-11","repo":{"name":"github.com/AlexanderFabisch/gmr","commit":"40cde12a853a37178d6239cc1d4f7b928b0149b2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.4,"checks":[{"name":"Maintained","score":10,"reason":"20 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 1/14 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/python-package.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/AlexanderFabisch/gmr/python-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/AlexanderFabisch/gmr/python-package.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/python-package.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/AlexanderFabisch/gmr/python-package.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:28","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:29","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:30","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   3 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 18 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-14T14:37:49.044Z","repository_id":14408607,"created_at":"2025-08-14T14:37:49.044Z","updated_at":"2025-08-14T14:37:49.044Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28975278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T09:57:52.632Z","status":"ssl_error","status_checked_at":"2026-02-01T09:57:49.143Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["gaussian-mixture-models","machine-learning","python","regression"],"created_at":"2026-01-23T01:00:32.313Z","updated_at":"2026-02-01T10:00:42.881Z","avatar_url":"https://github.com/AlexanderFabisch.png","language":"Python","funding_links":[],"categories":["Public Groups and Projects on GitHub.com"],"sub_categories":[],"readme":"# gmr\n\n\u003e Gaussian Mixture Models (GMMs) for clustering and regression in Python.\n\n[![Coverage](https://codecov.io/gh/AlexanderFabisch/gmr/branch/master/graph/badge.svg?token=R7hSIxb8M2)](https://codecov.io/gh/AlexanderFabisch/gmr)\n[![DOI (JOSS)](https://joss.theoj.org/papers/10.21105/joss.03054/status.svg)](https://doi.org/10.21105/joss.03054)\n[![DOI (Zenodo)](https://zenodo.org/badge/17119390.svg)](https://zenodo.org/badge/latestdoi/17119390)\n\n![Example](https://raw.githubusercontent.com/AlexanderFabisch/gmr/master/gmr.png)\n\n[(Source code of example)](https://github.com/AlexanderFabisch/gmr/blob/master/examples/plot_regression.py)\n\n* Source code repository: https://github.com/AlexanderFabisch/gmr\n* License: [New BSD / BSD 3-clause](https://github.com/AlexanderFabisch/gmr/blob/master/LICENSE)\n* Releases: https://github.com/AlexanderFabisch/gmr/releases\n* [API documentation](https://alexanderfabisch.github.io/gmr/)\n\n## Documentation\n\n### Installation\n\nInstall from [PyPI](https://pypi.python.org/pypi):\n\n```bash\npip install gmr\n```\n\nIf you want to be able to run all examples, pip can install all necessary\nexamples with\n\n```bash\npip install gmr[all]\n```\n\nYou can also install `gmr` from source:\n\n```bash\npip install -e .\n```\n\n### Example\n\nEstimate GMM from samples, sample from GMM, and make predictions:\n\n```python\nimport numpy as np\nfrom gmr import GMM\n\n# Your dataset as a NumPy array of shape (n_samples, n_features):\nX = np.random.randn(100, 2)\n\ngmm = GMM(n_components=3, random_state=0)\ngmm.from_samples(X)\n\n# Estimate GMM with expectation maximization:\nX_sampled = gmm.sample(100)\n\n# Make predictions with known values for the first feature:\nx1 = np.random.randn(20, 1)\nx1_index = [0]\nx2_predicted_mean = gmm.predict(x1_index, x1)\n```\n\nFor more details, see:\n\n```python\nhelp(gmr)\n```\n\nor have a look at the\n[API documentation](https://alexanderfabisch.github.io/gmr/)\n\nYou can see the results of all the examples [here](https://github.com/AlexanderFabisch/gmr/tree/master/examples/examples-with-gmr.ipynb).\n\nYou can find worked examples in [this Google Colab notebook](https://colab.research.google.com/drive/1fJK7z8Jhn04O6NxuPZMdLCsXT5HjvnyD?usp=sharing).\n\n### How Does It Compare to scikit-learn?\n\nThere is an implementation of Gaussian Mixture Models for clustering in\n[scikit-learn](https://scikit-learn.org/stable/modules/generated/sklearn.mixture.GaussianMixture.html)\nas well. Regression could not be easily integrated in the interface of\nsklearn. That is the reason why I put the code in a separate repository.\nIt is possible to initialize GMR from sklearn though:\n\n```python\nfrom sklearn.mixture import GaussianMixture\nfrom gmr import GMM\ngmm_sklearn = GaussianMixture(n_components=3, covariance_type=\"diag\")\ngmm_sklearn.fit(X)\ngmm = GMM(\n    n_components=3, priors=gmm_sklearn.weights_, means=gmm_sklearn.means_,\n    covariances=np.array([np.diag(c) for c in gmm_sklearn.covariances_]))\n```\n\nFor model selection with sklearn we furthermore provide an optional\nregressor interface.\n\n\n### Gallery\n\n![](https://raw.githubusercontent.com/AlexanderFabisch/gmr/master/doc/sklearn_initialization.png)\n\n[Diagonal covariances](https://github.com/AlexanderFabisch/gmr/blob/master/examples/plot_iris_from_sklearn.py)\n\n![](https://raw.githubusercontent.com/AlexanderFabisch/gmr/master/doc/confidence_sampling.png)\n\n[Sample from confidence interval](https://github.com/AlexanderFabisch/gmr/blob/master/examples/plot_sample_mvn_confidence_interval.py)\n\n![](https://raw.githubusercontent.com/AlexanderFabisch/gmr/master/doc/trajectories.png)\n\n[Generate trajectories](https://github.com/AlexanderFabisch/gmr/blob/master/examples/plot_trajectories.py)\n\n![](https://raw.githubusercontent.com/AlexanderFabisch/gmr/master/doc/time_invariant_trajectories.png)\n\n[Sample time-invariant trajectories](https://github.com/AlexanderFabisch/gmr/blob/master/examples/plot_time_invariant_trajectories.py)\n\nYou can find [all examples here](https://github.com/AlexanderFabisch/gmr/tree/master/examples).\n\n\n### Saving a Model\n\nThis library does not directly offer a function to store fitted models. Since\nthe implementation is pure Python, it is possible, however, to use standard\nPython tools to store Python objects. For example, you can use pickle to\ntemporarily store a GMM:\n\n```python\nimport numpy as np\nimport pickle\nimport gmr\ngmm = gmr.GMM(n_components=2)\ngmm.from_samples(X=np.random.randn(1000, 3))\n\n# Save object gmm to file 'file'\npickle.dump(gmm, open(\"file\", \"wb\"))\n# Load object from file 'file'\ngmm2 = pickle.load(open(\"file\", \"rb\"))\n```\n\nIt might be required to store models more permanently than in a pickle file,\nwhich might break with a change of the library or with the Python version.\nIn this case you can choose a storage format that you like and store the\nattributes `gmm.priors`, `gmm.means`, and `gmm.covariances`. These can be\nused in the constructor of the GMM class to recreate the object and they can\nalso be used in other libraries that provide a GMM implementation. The\nMVN class only needs the attributes `mean` and `covariance` to define the\nmodel.\n\n\n### API Documentation\n\nAPI documentation is available [here](https://alexanderfabisch.github.io/gmr/).\n\n\n### Citation\n\nIf you use the library gmr in a scientific publication, I would appreciate\ncitation of the following paper:\n\n\u003e Fabisch, A., (2021). gmr: Gaussian Mixture Regression. Journal of Open Source\n\u003e Software, 6(62), 3054, https://doi.org/10.21105/joss.03054\n\nBibtex entry:\n\n```bibtex\n@article{Fabisch2021,\ndoi = {10.21105/joss.03054},\nurl = {https://doi.org/10.21105/joss.03054},\nyear = {2021},\npublisher = {The Open Journal},\nvolume = {6},\nnumber = {62},\npages = {3054},\nauthor = {Alexander Fabisch},\ntitle = {gmr: Gaussian Mixture Regression},\njournal = {Journal of Open Source Software}\n}\n```\n\n\n## Contributing\n\n### How can I contribute?\n\nIf you discover bugs, have feature requests, or want to improve the\ndocumentation, you can open an issue at the\n[issue tracker](https://github.com/AlexanderFabisch/gmr/issues)\nof the project.\n\nIf you want to contribute code, please open a pull request via\nGitHub by forking the project, committing changes to your fork,\nand then opening a\n[pull request](https://github.com/AlexanderFabisch/gmr/pulls)\nfrom your forked branch to the main branch of `gmr`.\n\n\n### Development Environment\n\nI would recommend to install `gmr` from source in editable mode with `pip` and\ninstall all dependencies:\n\n```bash\npip install -e .[all,test,doc]\n```\n\nYou can now run tests with\n\n```bash\npytest\n```\n\nThis will also generate a coverage report and output an HTML overview to\nthe folder `htmlcov/`.\n\n### Generate Documentation\n\nThe API documentation is generated with\n[pdoc3](https://pdoc3.github.io/pdoc/). If you want to regenerate it,\nyou can run\n\n```bash\npdoc gmr --html --skip-errors\n```\n\n\n## Related Publications\n\nThe first publication that presents the GMR algorithm is\n\n\u003e [1] Z. Ghahramani, M. I. Jordan, \"Supervised learning from incomplete data via an EM approach,\" Advances in Neural Information Processing Systems 6, 1994, pp. 120-127, https://proceedings.neurips.cc/paper/1993/hash/f2201f5191c4e92cc5af043eebfd0946-Abstract.html\n\nbut it does not use the term Gaussian Mixture Regression, which to my knowledge occurs first in\n\n\u003e [2] S. Calinon, F. Guenter and A. Billard, \"On Learning, Representing, and Generalizing a Task in a Humanoid Robot,\" in IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), vol. 37, no. 2, 2007, pp. 286-298, doi: [10.1109/TSMCB.2006.886952](https://doi.org/10.1109/TSMCB.2006.886952).\n\nA recent survey on various regression models including GMR is the following:\n\n\u003e [3] F. Stulp, O. Sigaud, \"Many regression algorithms, one unified model: A review,\" in Neural Networks, vol. 69, 2015, pp. 60-79, doi: [10.1016/j.neunet.2015.05.005](https://doi.org/10.1016/j.neunet.2015.05.005).\n\nSylvain Calinon has a good introduction in his [slides on nonlinear regression](https://calinon.ch/misc/EE613/EE613-nonlinearRegression.pdf) for his [machine learning course](http://calinon.ch/teaching_EPFL.htm).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlexanderFabisch%2Fgmr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAlexanderFabisch%2Fgmr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlexanderFabisch%2Fgmr/lists"}