{"id":48726428,"url":"https://github.com/stateful-y/yohou","last_synced_at":"2026-04-11T22:58:26.627Z","repository":{"id":339616532,"uuid":"1152449245","full_name":"stateful-y/yohou","owner":"stateful-y","description":"A time series forecasting package based on Scikit-Learn and Polars","archived":false,"fork":false,"pushed_at":"2026-04-09T19:49:22.000Z","size":2464,"stargazers_count":6,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-11T22:58:24.012Z","etag":null,"topics":["forecasting","ml","scikit-learn","time-series"],"latest_commit_sha":null,"homepage":"https://yohou.readthedocs.io/en/latest/","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/stateful-y.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-07T22:21:05.000Z","updated_at":"2026-04-09T17:54:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/stateful-y/yohou","commit_stats":null,"previous_names":["stateful-y/yohou"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/stateful-y/yohou","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stateful-y%2Fyohou","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stateful-y%2Fyohou/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stateful-y%2Fyohou/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stateful-y%2Fyohou/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stateful-y","download_url":"https://codeload.github.com/stateful-y/yohou/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stateful-y%2Fyohou/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31698152,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T21:17:31.016Z","status":"ssl_error","status_checked_at":"2026-04-11T21:17:24.556Z","response_time":54,"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":["forecasting","ml","scikit-learn","time-series"],"created_at":"2026-04-11T22:58:25.870Z","updated_at":"2026-04-11T22:58:26.620Z","avatar_url":"https://github.com/stateful-y.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/stateful-y/yohou/main/docs/assets/logo_light.png\"\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/stateful-y/yohou/main/docs/assets/logo_dark.png\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/stateful-y/yohou/main/docs/assets/logo_light.png\" alt=\"Yohou\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n[![Python Version](https://img.shields.io/pypi/pyversions/yohou)](https://pypi.org/project/yohou/)\n[![License](https://img.shields.io/github/license/stateful-y/yohou)](https://github.com/stateful-y/yohou/blob/main/LICENSE)\n[![PyPI Version](https://img.shields.io/pypi/v/yohou)](https://pypi.org/project/yohou/)\n[![Conda Version](https://img.shields.io/conda/vn/conda-forge/yohou)](https://anaconda.org/conda-forge/yohou)\n[![codecov](https://codecov.io/gh/stateful-y/yohou/branch/main/graph/badge.svg)](https://codecov.io/gh/stateful-y/yohou)\n\n## What is Yohou?\n\nYohou is a Scikit-Learn-compatible time series forecasting framework built on [Polars](https://pola.rs/). It treats forecasting as a supervised learning reduction problem: wrap any sklearn regressor and Yohou handles windowing, tabularization, and recursive prediction while preserving temporal structure. It supports both point and interval forecasting with native panel data capabilities.\n\nYohou extends sklearn's API with time series-specific operations (`observe`, `rewind`, `observe_predict`) so fitted forecasters can ingest new data incrementally without retraining. After fitting, every forecaster exposes the same `predict` / `predict_interval` / `observe_predict` interface whether it wraps a simple baseline or a full decomposition pipeline.\n\nCurrently, Yohou supports Python 3.11+.\n\n## What are the features of Yohou?\n\n- **Reduction forecasting**: Wrap any Scikit-Learn regressor (`Ridge`, `XGBRegressor`, ...) and Yohou tabularizes, fits, and predicts recursively via `PointReductionForecaster` and `IntervalReductionForecaster`.\n- **Incremental observation**: Call `observe()` to feed new data, `rewind()` to roll back state, and `observe_predict()` to fast-forward and forecast in one step, no refitting required.\n- **Composable pipelines**: Chain trend, seasonality, and residual forecasters with `DecompositionPipeline`, or build feature pipelines with `FeaturePipeline`, `FeatureUnion`, and `ColumnTransformer`.\n- **Preprocessing \u0026 stationarity**: Lag, rolling, and EMA window transforms, signal filters, sklearn scaler wrappers, imputation, outlier handling, and stationarity transforms like `SeasonalDifferencing`, `BoxCoxTransformer`, and Fourier seasonality estimation.\n- **Panel data support**: Prefix columns with `group__` and forecasters, transformers, and metrics operate across all groups automatically. Use `ColumnForecaster` or `LocalPanelForecaster` for per-group models.\n- **Interval forecasting**: Get calibrated prediction intervals via `SplitConformalForecaster`, `IntervalReductionForecaster` with `DistanceSimilarity`, and conformity scorers.\n- **Time-weighted training**: Weight recent or seasonal observations with `exponential_decay_weight`, `linear_decay_weight`, `seasonal_emphasis_weight`, and `compose_weights`, propagated via sklearn metadata routing.\n- **Cross-validation \u0026 tuning**: Temporal splitters (`ExpandingWindowSplitter`, `SlidingWindowSplitter`) and `GridSearchCV` / `RandomizedSearchCV` designed for time series with no data leakage across time.\n- **Metrics \u0026 visualization**: Point and interval scorers with timewise, componentwise, and groupwise aggregation. Plotly-based plotting functions for exploration, diagnostics, forecasting, and evaluation.\n- **Remote datasets**: Eight `fetch_*` functions download Monash/Zenodo time series on demand (`tourism_monthly`, `sunspot`, `tourism_quarterly`, `electricity_demand`, `dominick`, `pedestrian_counts`, `hospital`, `kdd_cup`) with local Parquet caching.\n\n## How to install Yohou?\n\nInstall the Yohou package using `pip`:\n\n```bash\npip install yohou\n```\n\nor using `uv`:\n\n```bash\nuv pip install yohou\n```\n\nor using `conda`:\n\n```bash\nconda install -c conda-forge yohou\n```\n\nor using `mamba`:\n\n```bash\nmamba install -c conda-forge yohou\n```\n\nor alternatively, add `yohou` to your `requirements.txt` or `pyproject.toml` file.\n\n## How to get started with Yohou?\n\n### 1. Load data and split\n\nYohou datasets are fetched from [Monash/Zenodo](https://forecastingdata.org) and return a `Bunch` with a `.frame` attribute (a Polars DataFrame with a `\"time\"` column).\n\n```python\nfrom yohou.datasets import fetch_tourism_monthly\n\nbunch = fetch_tourism_monthly()\ny = bunch.frame.select(\"time\", \"T1__tourists\").rename({\"T1__tourists\": \"tourists\"})\ny_train, y_test = y[:280], y[280:]\n```\n\n### 2. Fit a forecaster\n\nWrap an sklearn regressor in a `PointReductionForecaster` with preprocessing pipelines.\n\n```python\nfrom sklearn.linear_model import Ridge\n\nfrom yohou.compose import FeaturePipeline\nfrom yohou.point import PointReductionForecaster\nfrom yohou.preprocessing import LagTransformer\nfrom yohou.stationarity import LogTransformer, SeasonalDifferencing\n\nforecaster = PointReductionForecaster(\n    estimator=Ridge(alpha=10),\n    target_transformer=FeaturePipeline([\n        (\"log\", LogTransformer(offset=1.0)),\n        (\"diff\", SeasonalDifferencing(seasonality=12)),\n    ]),\n    feature_transformer=FeaturePipeline([\n        (\"lag\", LagTransformer(lag=[1, 2, 3])),\n    ]),\n)\nforecaster.fit(y_train, X=None, forecasting_horizon=len(y_test))\n```\n\n### 3. Predict and evaluate\n\nAfter fitting, call `predict` and score against the held-out data.\n\n```python\nfrom yohou.metrics import MeanAbsoluteError\nfrom yohou.plotting import plot_forecast\n\ny_pred = forecaster.predict(forecasting_horizon=len(y_test))\nscorer = MeanAbsoluteError()\nscorer.fit(y_train)\nscorer.score(y_test, y_pred)\nplot_forecast(y_test, y_pred, y_train=y_train)\n```\n\n## How do I use Yohou?\n\nFull documentation is available at [https://yohou.readthedocs.io/](https://yohou.readthedocs.io/).\n\nInteractive examples are available in the `examples/` directory:\n\n- **Online**: [https://yohou.readthedocs.io/en/latest/pages/examples/](https://yohou.readthedocs.io/en/latest/pages/examples/)\n- **Locally**: Run `marimo edit examples/quickstart.py` to open an interactive notebook\n\n## Can I contribute?\n\nWe welcome contributions, feedback, and questions:\n\n- **Report issues or request features**: [GitHub Issues](https://github.com/stateful-y/yohou/issues)\n- **Join the discussion**: [GitHub Discussions](https://github.com/stateful-y/yohou/discussions)\n- **Contributing Guide**: [CONTRIBUTING.md](https://github.com/stateful-y/yohou/blob/main/CONTRIBUTING.md)\n\nIf you are interested in becoming a maintainer or taking a more active role, please reach out to Guillaume Tauzin on [GitHub Discussions](https://github.com/stateful-y/yohou/discussions).\n\n## Where can I learn more?\n\nHere are the main Yohou resources:\n\n- Full documentation: [https://yohou.readthedocs.io/](https://yohou.readthedocs.io/)\n- GitHub Discussions: [https://github.com/stateful-y/yohou/discussions](https://github.com/stateful-y/yohou/discussions)\n- Interactive Examples: [https://yohou.readthedocs.io/en/latest/pages/examples/](https://yohou.readthedocs.io/en/latest/pages/examples/)\n\nFor questions and discussions, you can also open a [discussion](https://github.com/stateful-y/yohou/discussions).\n\n## License\n\nThis project is licensed under the terms of the [Apache-2.0 License](https://github.com/stateful-y/yohou/blob/main/LICENSE).\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://stateful-y.io\"\u003e\n    \u003cimg src=\"docs/assets/made_by_stateful-y.png\" alt=\"Made by stateful-y\" width=\"200\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstateful-y%2Fyohou","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstateful-y%2Fyohou","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstateful-y%2Fyohou/lists"}