{"id":41947888,"url":"https://github.com/CDonnerer/xgboost-distribution","last_synced_at":"2026-02-04T17:01:30.844Z","repository":{"id":37952183,"uuid":"370157362","full_name":"CDonnerer/xgboost-distribution","owner":"CDonnerer","description":"Probabilistic prediction with XGBoost.","archived":false,"fork":false,"pushed_at":"2025-03-22T17:50:22.000Z","size":481,"stargazers_count":106,"open_issues_count":12,"forks_count":18,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-22T18:28:47.663Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CDonnerer.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","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":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-23T21:06:20.000Z","updated_at":"2025-03-22T17:49:27.000Z","dependencies_parsed_at":"2025-02-14T20:23:22.464Z","dependency_job_id":null,"html_url":"https://github.com/CDonnerer/xgboost-distribution","commit_stats":{"total_commits":62,"total_committers":1,"mean_commits":62.0,"dds":0.0,"last_synced_commit":"ca14d6081e5fd0f70561e0f487420417f9e90fc3"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/CDonnerer/xgboost-distribution","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CDonnerer%2Fxgboost-distribution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CDonnerer%2Fxgboost-distribution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CDonnerer%2Fxgboost-distribution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CDonnerer%2Fxgboost-distribution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CDonnerer","download_url":"https://codeload.github.com/CDonnerer/xgboost-distribution/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CDonnerer%2Fxgboost-distribution/sbom","scorecard":{"id":25788,"data":{"date":"2025-08-11","repo":{"name":"github.com/CDonnerer/xgboost-distribution","commit":"42189473de9d03bcc043f709c3512595247a2b35"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","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":"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/build.yml:1","Warn: no topLevel permission defined: .github/workflows/test.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":"Code-Review","score":0,"reason":"Found 1/30 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":"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/build.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/CDonnerer/xgboost-distribution/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/CDonnerer/xgboost-distribution/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/CDonnerer/xgboost-distribution/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/CDonnerer/xgboost-distribution/test.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:26","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:32","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 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":"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":"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.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 30 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-14T17:50:19.900Z","repository_id":37952183,"created_at":"2025-08-14T17:50:19.900Z","updated_at":"2025-08-14T17:50:19.900Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29091317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T03:31:03.593Z","status":"ssl_error","status_checked_at":"2026-02-04T03:29:50.742Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2026-01-25T20:00:26.261Z","updated_at":"2026-02-04T17:01:30.839Z","avatar_url":"https://github.com/CDonnerer.png","language":"Python","readme":".. image:: https://github.com/CDonnerer/xgboost-distribution/actions/workflows/test.yml/badge.svg?branch=main\n  :target: https://github.com/CDonnerer/xgboost-distribution/actions/workflows/test.yml\n\n.. image:: https://coveralls.io/repos/github/CDonnerer/xgboost-distribution/badge.svg?branch=main\n  :target: https://coveralls.io/github/CDonnerer/xgboost-distribution?branch=main\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n  :target: https://github.com/psf/black\n\n.. image:: https://readthedocs.org/projects/xgboost-distribution/badge/?version=latest\n  :target: https://xgboost-distribution.readthedocs.io/en/latest/?badge=latest\n  :alt: Documentation Status\n\n.. image:: https://img.shields.io/pypi/v/xgboost-distribution.svg\n  :alt: PyPI-Server\n  :target: https://pypi.org/project/xgboost-distribution/\n\n\n====================\nxgboost-distribution\n====================\n\nXGBoost for probabilistic prediction. Like `NGBoost`_, but `faster`_, and in the `XGBoost scikit-learn API`_.\n\n.. image:: https://raw.githubusercontent.com/CDonnerer/xgboost-distribution/main/imgs/xgb_dist.png\n    :align: center\n    :width: 600px\n    :alt: XGBDistribution example\n\n\nInstallation\n============\n\n.. code-block:: console\n\n    $ pip install xgboost-distribution\n    $ pip install xgboost-distribution[gpu]  # for GPU support\n\n\n`Dependencies`_:\n\n.. code-block::\n\n    python_requires = \u003e=3.10\n\n    install_requires =\n        scikit-learn\n        xgboost\u003e=3.0.0\n\n\nUsage\n===========\n\n``XGBDistribution`` follows the `XGBoost scikit-learn API`_, with an additional keyword\nargument specifying the distribution, which is fit via `Maximum Likelihood Estimation`_:\n\n\n.. code-block:: python\n\n      from sklearn.datasets import fetch_california_housing\n      from sklearn.model_selection import train_test_split\n\n      from xgboost_distribution import XGBDistribution\n\n\n      data = fetch_california_housing()\n      X, y = data.data, data.target\n      X_train, X_test, y_train, y_test = train_test_split(X, y)\n\n      model = XGBDistribution(\n          distribution=\"normal\",\n          n_estimators=500,\n          early_stopping_rounds=10\n      )\n      model.fit(X_train, y_train, eval_set=[(X_test, y_test)])\n\n\nSee the `documentation`_ for all available distributions.\n\nNote: We recommend using early stopping to avoid overfitting, as otherwise the\ndetermined distribution parameters can become unreliable.\n\nAfter fitting, we can predict the parameters of the distribution:\n\n.. code-block:: python\n\n      preds = model.predict(X_test)\n      mean, std = preds.loc, preds.scale\n\n\nNote that this returned a `namedtuple`_ of `numpy arrays`_ for each parameter of the\ndistribution (we use the `scipy stats`_ naming conventions for the parameters, see e.g.\n`scipy.stats.norm`_ for the normal distribution).\n\n\nNGBoost performance comparison\n===============================\n\n``XGBDistribution`` follows the method shown in the `NGBoost`_ library, using natural\ngradients to estimate the parameters of the distribution.\n\nBelow, we show a performance comparison of ``XGBDistribution`` and the `NGBoost`_\n``NGBRegressor``, using the California Housing dataset, estimating normal distributions.\nWhile the performance of the two models is fairly similar (measured on negative\nlog-likelihood of a normal distribution and the RMSE), ``XGBDistribution`` is around\n**15x faster** (timed on both fit and predict steps):\n\n.. image:: https://raw.githubusercontent.com/CDonnerer/xgboost-distribution/main/imgs/performance_comparison.png\n          :align: center\n          :width: 600px\n          :alt: XGBDistribution vs NGBoost\n\n\nPlease see the `experiments page`_ for results across various datasets.\n\n\nFull XGBoost features\n======================\n\n``XGBDistribution`` offers the full set of XGBoost features available in the\n`XGBoost scikit-learn API`_, allowing, for example, probabilistic regression\nwith `monotonic constraints`_:\n\n.. image:: https://raw.githubusercontent.com/CDonnerer/xgboost-distribution/main/imgs/monotone_constraint.png\n          :align: center\n          :width: 600px\n          :alt: XGBDistribution monotonic constraints\n\n\nAcknowledgements\n=================\n\nThis package would not exist without the excellent work from:\n\n- `NGBoost`_ - Which demonstrated how gradient boosting with natural gradients\n  can be used to estimate parameters of distributions. Much of the gradient\n  calculations code were adapted from there.\n\n- `XGBoost`_ - Which provides the gradient boosting algorithms used here, in\n  particular the ``sklearn`` APIs were taken as a blue-print.\n\n\n.. _pyscaffold-notes:\n\nNote\n====\n\nThis project has been set up using PyScaffold 4.0.1. For details and usage\ninformation on PyScaffold see https://pyscaffold.org/.\n\n\n.. _ngboost: https://github.com/stanfordmlgroup/ngboost\n.. _faster:  https://xgboost-distribution.readthedocs.io/en/latest/experiments.html\n.. _xgboost scikit-learn api: https://xgboost.readthedocs.io/en/latest/python/python_api.html#module-xgboost.sklearn\n.. _dependencies: https://github.com/CDonnerer/xgboost-distribution/blob/feature/update-linting/setup.cfg#L37\n.. _monotonic constraints: https://xgboost.readthedocs.io/en/latest/tutorials/monotonic.html\n.. _scipy.stats.norm: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.norm.html\n.. _LAPACK gesv: https://www.netlib.org/lapack/lug/node71.html\n.. _xgboost: https://github.com/dmlc/xgboost\n.. _documentation: https://xgboost-distribution.readthedocs.io/en/latest/api/xgboost_distribution.XGBDistribution.html#xgboost_distribution.XGBDistribution\n.. _experiments page: https://xgboost-distribution.readthedocs.io/en/latest/experiments.html\n.. _numpy arrays: https://numpy.org/doc/stable/reference/generated/numpy.array.html\n.. _scipy stats: https://docs.scipy.org/doc/scipy/reference/stats.html\n.. _namedtuple: https://docs.python.org/3/library/collections.html#collections.namedtuple\n.. _maximum likelihood estimation: https://en.wikipedia.org/wiki/Maximum_likelihood_estimation\n","funding_links":[],"categories":["Implementations"],"sub_categories":["Other Frameworks"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCDonnerer%2Fxgboost-distribution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCDonnerer%2Fxgboost-distribution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCDonnerer%2Fxgboost-distribution/lists"}