optuna-nested-cv

Community

Run resumable Optuna searches with nested CV

Authorthistleknot
Version1.0.0
Installs0

System Documentation

What problem does it solve?

It eliminates unreliable hyperparameter tuning by running a persistent Optuna search inside a nested cross-validation structure, producing an unbiased generalization estimate while preventing holdout leakage.

Core Features & Use Cases

  • Nested CV for unbiased evaluation: Uses an outer holdout fold for evaluation and an inner Optuna study to tune only on the outer training split.
  • Resumable SQLite-backed studies: Ensures trials are auditable and restartable via a stable study name and persistent storage.
  • Scalar objective + composite scoring: Supports single-scalar optimization (including composite objectives) to keep selection unambiguous.
  • Split discipline (tune vs holdout): Enforces explicit bank roles so the search never “peeks” at the evaluation data.
  • Sampler-policy contract: Keeps sampling regimes consistent between search and final training, so results transfer correctly.
  • Use in tuning expensive pipelines: Designed for costly evaluations where the search budget must be efficiently managed and results must generalize.

Quick Start

Use the optuna-nested-cv skill to run an Optuna TPE hyperparameter search over an inner loop for each outer CV fold, persisting trials to sqlite and reporting the mean outer-fold score as the unbiased estimate.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: optuna-nested-cv
Download link: https://github.com/thistleknot/skills/archive/main.zip#optuna-nested-cv

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.