Skip to content

Examples

Interactive notebooks grouped by purpose: Tutorials walk through a topic step-by-step, while How-to Guides solve a specific task. Each notebook is available in two formats: View for static reading, and Open in marimo for an interactive notebook that runs in the marimo playground.

Tutorials

  • OptunaSearchCV Quickstart


    Run a fast hyperparameter search and read the best parameters and score.

    View · Open in marimo

How-to Guides

  • How to Stop Optimization Early with Callbacks


    Stop unneeded work early by adding Optuna callbacks to your search.

    View · Open in marimo

  • How to Choose and Configure a Sampler


    Control the optimization algorithm and get reproducible results with Optuna samplers.

    View · Open in marimo

  • How to Handle Failing Trials


    Control what happens when a hyperparameter combination causes fitting to fail.

    View · Open in marimo

  • How to Route Sample Weights Through OptunaSearchCV


    Pass sample_weight through OptunaSearchCV to both fitting and scoring.

    View · Open in marimo

  • How to Tune Pipeline Parameters


    Tune hyperparameters across multiple pipeline steps with OptunaSearchCV.

    View · Open in marimo

  • How to Score Multiple Metrics


    Evaluate hyperparameter configurations against multiple scoring metrics at once.

    View · Open in marimo

  • How to Resume Optimization from Prior Trials


    Reuse an Optuna study to continue optimization runs and keep experiments reproducible.

    View · Open in marimo

  • How to Visualize Optimization History


    Plot optimization progress and parameter relationships from a completed search.

    View · Open in marimo

Running Examples Locally

All examples are marimo notebooks. Open any example interactively:

# Via just (pass the filename without .py)
just example quickstart
just example callbacks

# Or directly with marimo
uv run marimo edit examples/quickstart.py

Next Steps