{"id":37600635,"url":"https://github.com/simon-hirsch/ondil","last_synced_at":"2026-01-16T10:02:50.223Z","repository":{"id":246243534,"uuid":"820472213","full_name":"simon-hirsch/ondil","owner":"simon-hirsch","description":"A package for online distributional learning. ","archived":false,"fork":false,"pushed_at":"2026-01-13T10:52:13.000Z","size":7620,"stargazers_count":29,"open_issues_count":25,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-13T10:57:43.548Z","etag":null,"topics":["distributional-forecasting","distributional-regression","gam","gamlss","location-scale-and-shape","machine-learning","online-learning","probabilistic-forecasting","python","statistical-learning","volatility-modeling"],"latest_commit_sha":null,"homepage":"https://simon-hirsch.github.io/ondil/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simon-hirsch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"2024-06-26T14:31:26.000Z","updated_at":"2026-01-09T09:13:17.000Z","dependencies_parsed_at":"2025-12-17T15:04:01.647Z","dependency_job_id":null,"html_url":"https://github.com/simon-hirsch/ondil","commit_stats":null,"previous_names":["simon-hirsch/rolch","simon-hirsch/ondil"],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/simon-hirsch/ondil","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon-hirsch%2Fondil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon-hirsch%2Fondil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon-hirsch%2Fondil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon-hirsch%2Fondil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simon-hirsch","download_url":"https://codeload.github.com/simon-hirsch/ondil/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon-hirsch%2Fondil/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: 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":["distributional-forecasting","distributional-regression","gam","gamlss","location-scale-and-shape","machine-learning","online-learning","probabilistic-forecasting","python","statistical-learning","volatility-modeling"],"created_at":"2026-01-16T10:02:50.009Z","updated_at":"2026-01-16T10:02:50.205Z","avatar_url":"https://github.com/simon-hirsch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `ondil`: Online Distributional Learning\n\n[![Open Source Love](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)\n[![License](https://img.shields.io/github/license/simon-hirsch/rolch)](https://opensource.org/license/gpl-3-0)\n![GitHub Release](https://img.shields.io/github/v/release/simon-hirsch/ondil?display_name=release\u0026label=Release)\n[![Downloads](https://static.pepy.tech/badge/ondil)](https://pepy.tech/project/ondil)\n[![Tests](https://github.com/simon-hirsch/ondil/actions/workflows/ci_run_tests.yml/badge.svg?branch=main)](https://github.com/simon-hirsch/ondil/actions/workflows/ci_run_tests.yml)\n[![Docs](https://github.com/simon-hirsch/ondil/actions/workflows/ci_build_docs.yml/badge.svg?branch=main)](https://github.com/simon-hirsch/ondil/actions/workflows/ci_build_docs.yml)\n[![CodeFactor](https://www.codefactor.io/repository/github/simon-hirsch/ondil/badge)](https://www.codefactor.io/repository/github/simon-hirsch/ondil)\n\n## Introduction\n\nThis package provides an online estimation of distributional regression and linear regression models in Python. We provide:\n\n- Online linear regression models including regularization (Lasso, Ridge, Elastic Net).\n- An online implementation of the generalized additive models for location, shape and scale (GAMLSS, see [Rigby \u0026 Stasinopoulos, 2005](https://academic.oup.com/jrsssc/article-abstract/54/3/507/7113027)) developed in [Hirsch, Berrisch \u0026 Ziel, 2024](https://arxiv.org/abs/2407.08750).\n- The multivariate extension for online distributional regression models developed in [Hirsch, 2025](https://arxiv.org/abs/2504.02518).\n\nAll models are implemented in a way that they are fully compatible with `scikit-learn` estimators and transformers. The main advantage of the online approach is that the model can be updated incrementally using `model.update(X, y)` without the need to refit the whole model from scratch. This is especially useful for large datasets or streaming data. \n\nPlease have a look at the [documentation](https://simon-hirsch.github.io/ondil/) or the [example files](https://github.com/simon-hirsch/ondil/tree/main/examples). We're actively working on the package and welcome contributions from the community. Have a look at the [Release Notes](https://github.com/simon-hirsch/ondil/releases) and the [Issue Tracker](https://github.com/simon-hirsch/ondil/issues).\n\n## Distributional Regression\n\nThe main idea of distributional regression (or regression beyond the mean, multiparameter regression) is that the response variable $Y$ is distributed according to a specified distribution $\\mathcal{F}(\\theta)$, where $\\theta$ is the parameter vector for the distribution. In the Gaussian case, we have $\\theta = (\\theta_1, \\theta_2) = (\\mu, \\sigma)$. We then specify an individual regression model for all parameters of the distribution of the form\n\n$$g_k(\\theta_k) = \\eta_k = X_k\\beta_k$$\n\nwhere $g_k(\\cdot)$ is a link function, which ensures that the predicted distribution parameters are in a sensible range (we don't want, e.g. negative standard deviations), and $\\eta_k$ is the predictor. For the Gaussian case, this would imply that we have two regression equations, one for the mean (location) and one for the standard deviation (scale) parameters. Distributions other than the normal distribution are possible, and we have already implemented them, e.g., Student's $t$-distribution and Johnson's $S_U$ distribution. If you are interested in another distribution, please open an Issue.\n\nThis allows us to specify very flexible models that consider the conditional behaviour of the variable's volatility, skewness and tail behaviour. A simple example for electricity markets is wind forecasts, which are skewed depending on the production level - intuitively, there is a higher risk of having lower production if the production level is already high since it cannot go much higher than \"full load\" and if, the turbines might cut-off. Modelling these conditional probabilistic behaviours is the key strength of distributional regression models.\n\n## Features\n\n- 🚀 First native `Python` implementation of generalized additive models for location, shape and scale (GAMLSS).\n- 🚀 Online-first approach, which allows for incremental updates of the model using `model.update(X, y)`.\n- 🚀 Support for various distributions, including Gaussian, Student's $t$, Johnson's $S_U$, Gamma, Log-normal, Exponential, Beta, Gumbel, Inverse Gaussian and more. Implementing new distributions is straight-forward.\n- 🚀 Flexible link functions for each distribution, allowing for custom transformations of the parameters.\n- 🚀 Support for regularization methods like Lasso, Ridge and Elastic Net.\n- 🚀 Fast and efficient implementation using [`numba`](https://numba.pydata.org/) for just-in-time compilation.\n- 🚀 Full compatibility with [`scikit-learn`](https://scikit-learn.org/stable/) estimators and transformers.\n\n## Example\n\nBasic estimation and updating procedure:\n\n```python\nimport numpy as np\nfrom sklearn.datasets import load_diabetes\nfrom ondil.estimators import OnlineDistributionalRegression\nfrom ondil.distributions import StudentT\n\nX, y = load_diabetes(return_X_y=True)\n\n# Model coefficients\nequation = {\n    0: \"all\",  # Can also use \"intercept\" or np.ndarray of integers / booleans\n    1: \"all\",\n    2: \"all\",\n}\n\n# Create the estimator\nonline_gamlss_lasso = OnlineDistributionalRegression(\n    distribution=StudentT(),\n    method=\"lasso\",\n    equation=equation,\n    fit_intercept=True,\n    ic=\"bic\",\n)\n\n# Initial Fit\nonline_gamlss_lasso.fit(\n    X=X[:-11, :],\n    y=y[:-11],\n)\nprint(\"Coefficients for the first N-11 observations \\n\")\nprint(online_gamlss_lasso.beta)\n\n# Update call\nonline_gamlss_lasso.update(X=X[[-11], :], y=y[[-11]])\nprint(\"\\nCoefficients after update call \\n\")\nprint(online_gamlss_lasso.beta)\n\n# Prediction for the last 10 observations\nprediction = online_gamlss_lasso.predict_distribution_parameters(X=X[-10:, :])\n\nprint(\"\\n Predictions for the last 10 observations\")\n# Location, scale and shape (degrees of freedom)\nprint(prediction)\n```\n\n## Installation \u0026 Dependencies\n\nThe package is available from [pypi](https://pypi.org/project/ondil/) - do `pip install ondil` and enjoy.\n\n`ondil` is designed to have minimal dependencies. We rely on `python\u003e=3.10`, `numpy`, `numba`, `scipy` and `scikit-learn` in a reasonably up-to-date versions.\n\n## I was looking for `rolch` but I found `ondil`?\n\n`rolch` (Regularized Online Learning for Conditional Heteroskedasticity) was the original name of this package, but we decided to rename it to `ondil` (Online Distributional Learning) to better reflect its purpose and functionality, since conditional heteroskedasticity (=non constant variance) is just one of the many applications for distributional regression models that can be estimated with this package.\n\n## Contributing\n\nWe welcome every contribution from the community. Feel free to open an issue if you find bugs or want to propose changes. We're still in an early phase and welcome feedback, especially on the usability and \"look and feel\" of the package. Secondly, we're working to port distributions from the `R`-GAMLSS package and welcome according PRs.\n\n## Contributors\n\n`ondil` was developed by Simon Hirsch, Jonathan Berrisch and Florian Ziel. \nWe're grateful for contributions below (sorted alphabetically by GitHub username).\n\n| Contribution | GitHub Users |\n|-------------------|--------------|\n| Code | [@BerriJ](https://github.com/BerriJ), [@Jaiminoza229984](https://github.com/Jaiminoza229984), [@flziel](https://github.com/flziel), [@joza26](https://github.com/joza26), [@murthy-econometrics-5819](https://github.com/murthy-econometrics-5819), [@simon-hirsch](https://github.com/simon-hirsch) |\n| Reported (closed) Issues | [@BerriJ](https://github.com/BerriJ), [@Jaiminoza229984](https://github.com/Jaiminoza229984), [@fkiraly](https://github.com/fkiraly), [@joshdunnlime](https://github.com/joshdunnlime), [@murthy-econometrics-5819](https://github.com/murthy-econometrics-5819), [@simon-hirsch](https://github.com/simon-hirsch) |\n| Merged PRs | [@BerriJ](https://github.com/BerriJ), [@Jaiminoza229984](https://github.com/Jaiminoza229984), [@flziel](https://github.com/flziel), [@murthy-econometrics-5819](https://github.com/murthy-econometrics-5819), [@simon-hirsch](https://github.com/simon-hirsch) |\n| PR Reviews | [@BerriJ](https://github.com/BerriJ), [@copilot-pull-request-reviewer[bot]](https://github.com/copilot-pull-request-reviewer[bot]), [@fkiraly](https://github.com/fkiraly), [@giulianolmsk](https://github.com/giulianolmsk), [@simon-hirsch](https://github.com/simon-hirsch) |\n\n## Acknowledgements \u0026 Disclosure\n\nSimon Hirsch is employed at Statkraft and gratefully acknowledges support received from Statkraft for his Ph.D. studies. This work contains the author's opinion and not necessarily reflects Statkraft's position.\n\n## Citation\n\nIf you use `ondil` in your research, please cite the following paper(s), depending on what you've used. Thank you!\n\n```bibtex\n@article{hirsch2024online,\n  title={Online distributional regression},\n  author={Hirsch, Simon and Berrisch, Jonathan and Ziel, Florian},\n  journal={arXiv preprint arXiv:2407.08750},\n  year={2024}\n}\n\n@article{hirsch2025online,\n  title={Online Multivariate Regularized Distributional Regression for High-dimensional Probabilistic Electricity Price Forecasting},\n  author={Hirsch, Simon},\n  journal={arXiv preprint arXiv:2504.02518},\n  year={2025}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimon-hirsch%2Fondil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimon-hirsch%2Fondil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimon-hirsch%2Fondil/lists"}