A cookbook for tuning models from XGBoost to Transformers
Working code samples that wire Optuna into dozens of ML frameworks, because API documentation rarely shows the full plumbing.

What it does
This repository is the official companion to Optuna, a Python framework for hyperparameter optimization. It collects minimal, runnable scripts demonstrating how to search for better model settings across dozens of libraries and infrastructure setups. If the main Optuna library is the engine, this repo is the field manual showing exactly where to bolt it on.
The interesting bit
The coverage is almost aggressively comprehensive: integration examples span Catalyst, CatBoost, Dask-ML, FastAI, Haiku, Keras, LightGBM, PyTorch Lightning, RAPIDS, Scikit-learn, SKORCH, Hugging Face Transformers, TensorFlow, XGBoost, and even stable-baselines reinforcement learning. It also demonstrates advanced features like pruning callbacks, warm-starting CMA-ES, custom samplers, and the Optuna Terminator. For a documentation repo, it is refreshingly execution-oriented.
Key highlights
- Covers the long tail of ML frameworks, from PyTorch and Keras to RAPIDS, CatBoost, and Hugging Face Transformers
- Includes distributed optimization patterns for Dask, Kubernetes, and Ray
- Demonstrates pruning integrations that halt unpromising trials early across most major libraries
- Ships with Docker images for running most examples without local dependency wrangling
- Links to real-world external projects using Optuna, from Mozilla Voice STT to molecular optimization
Verdict
Grab this if you are already using Optuna and need to see how it plugs into a specific framework without spelunking through the main library’s source. Skip it if you are looking for the core Optuna engine itself—that lives in the main repository.
Frequently asked
- What is optuna/optuna-examples?
- Working code samples that wire Optuna into dozens of ML frameworks, because API documentation rarely shows the full plumbing.
- Is optuna-examples open source?
- Yes — optuna/optuna-examples is open source, released under the MIT license.
- What language is optuna-examples written in?
- optuna/optuna-examples is primarily written in Python.
- How popular is optuna-examples?
- optuna/optuna-examples has 854 stars on GitHub.
- Where can I find optuna-examples?
- optuna/optuna-examples is on GitHub at https://github.com/optuna/optuna-examples.