Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Yohou-Optuna

Python Version License PyPI Version Conda Version codecov

What is Yohou-Optuna?

Yohou-Optuna brings Optuna's hyperparameter optimization to Yohou, providing a Yohou-compatible search class for time series forecasting.

This integration replaces grid and random search with adaptive sampling (TPE, CMA-ES, and more) while keeping Yohou's forecasting API intact. After fitting, OptunaSearchCV behaves like a Yohou forecaster, so you can call predict, observe, and observe_predict directly.

It integrates with Optuna's distributions, samplers, and storages, and wraps them for sklearn-style cloning and serialization.

What are the features of Yohou-Optuna?

  • Adaptive optimization: Run Optuna studies over Yohou forecasters with TPE, CMA-ES, and other samplers to find better configurations in fewer trials.
  • Forecaster-native API: OptunaSearchCV is a forecaster after fitting, so you can call predict, observe, observe_predict, and interval methods.
  • Clone-safe wrappers: Sampler, Storage, Callback, and Pruner wrappers ensure Optuna objects survive sklearn cloning and serialization.
  • Fold-level pruning: Pass a Pruner to stop a trial after a few backtest windows when it is reliably worse than the best one, with the most recent windows judged first by default.
  • Time-series CV support: Works with Yohou splitters for proper temporal validation and scorer integration.
  • Multi-metric evaluation: Evaluate multiple scorers and refit on the one that matters most for your use case.
  • (Experimental) Persistence workflows: Resume studies with storage-backed optimization and continue tuning over time.

How to install Yohou-Optuna?

Install the Yohou-Optuna package using pip:

pip install yohou_optuna

or using uv:

uv pip install yohou_optuna

or using conda:

conda install -c conda-forge yohou_optuna

or using mamba:

mamba install -c conda-forge yohou_optuna

or alternatively, add yohou_optuna to your requirements.txt or pyproject.toml file.

How to get started with Yohou-Optuna?

1. Prepare a forecaster and search space

Define a Yohou forecaster and Optuna distributions for the parameters you want to tune.

from sklearn.linear_model import Ridge
from optuna.distributions import FloatDistribution, IntDistribution

from yohou.point import PointReductionForecaster
from yohou_optuna import OptunaSearchCV

forecaster = PointReductionForecaster(estimator=Ridge())
param_distributions = {
    "estimator__alpha": FloatDistribution(1e-4, 10.0, log=True),
    "observation_horizon": IntDistribution(3, 30),
}

search = OptunaSearchCV(
    forecaster=forecaster,
    param_distributions=param_distributions,
    n_trials=30,
)

2. Fit the searcher

Fit the searcher on your time series data (polars DataFrame with a time column).

search.fit(y_train, X_train, forecasting_horizon=12)

3. Predict with the best forecaster

After fitting, search behaves like a Yohou forecaster.

y_pred = search.predict(forecasting_horizon=12)
print(search.best_params_)

How do I use Yohou-Optuna?

Full documentation is available at https://yohou-optuna.readthedocs.io/.

Interactive examples are available in the examples/ directory:

Can I contribute?

We welcome contributions, feedback, and questions:

If you are interested in becoming a maintainer or taking a more active role, please reach out to Guillaume Tauzin on GitHub Discussions.

Where can I learn more?

Here are the main Yohou-Optuna resources:

For questions and discussions, you can also open a discussion.

License

This project is licensed under the terms of the Apache-2.0 License.

How do I cite Yohou-Optuna?

If you use Yohou-Optuna in work you publish, please cite it:

Guillaume Tauzin. Yohou-Optuna: An Optuna integration for hyperparameter tuning in Yohou. https://github.com/stateful-y/yohou-optuna

Or in BibTeX:

@software{yohou_optuna,
  author  = "Guillaume Tauzin",
  title   = "{Yohou-Optuna: An Optuna integration for hyperparameter tuning in Yohou}",
  url     = "https://github.com/stateful-y/yohou-optuna",
  license = "Apache-2.0"
}

Reference managers can read CITATION.cff directly. To cite a specific version, see the citation page.

Acknowledgements

This project is maintained by stateful-y, an ML consultancy specializing in time series data science & engineering. If you're interested in collaborating or learning more about our services, please visit our website.

Made by stateful-y

Metadata

Release files for yohou-optuna 0.1.0a13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yohou-optuna 0.1.0a13
File Size Uploaded Provenance Actions
yohou_optuna-0.1.0a13.tar.gz 524.2 kB With provenance Details for yohou_optuna-0.1.0a13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for yohou-optuna 0.1.0a13
File Interpreter ABI Platform Actions
yohou_optuna-0.1.0a13-py3-none-any.whl Python 3 none any Details for yohou_optuna-0.1.0a13-py3-none-any.whl

Total release size: 553.6 kB

Release files / yohou_optuna-0.1.0a13.tar.gz

Download URL yohou_optuna-0.1.0a13.tar.gz
Size 524.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c452d632064a9f534459bcf6c3205b8fc806c52eb4a946585311e077367a382f
BLAKE2b-256 checksum
How to use checksums
b56489c6eb816bcaa084dd99c250cda0b425c3f3904265c8827b925ce3050aa5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Release files / yohou_optuna-0.1.0a13-py3-none-any.whl

Download URL yohou_optuna-0.1.0a13-py3-none-any.whl
Size 29.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1cf9505ea7ec61d3590ff7df031b674102e4853b2f9ab2ba32b213960929a265
BLAKE2b-256 checksum
How to use checksums
2d20a9482cd957128761a6c6a0b52bd125bb2f49dc09a4bf3a9f393a4a2c9395
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Security for yohou-optuna 0.1.0a13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for yohou_optuna-0.1.0a13.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page