Hyperparameter Optimisation¶
Optuna-based hyperparameter-optimisation layer (tinycta.hyper).
Installed via the optional hyper extra:
tinycta.hyper
¶
Hyperparameter optimisation support via Optuna.
Public API¶
Study: Frozen dataclass wrapping a completed Optuna study.optimize: Convenience wrapper: build objective, run study, print, returnStudy.get_config: Set up logger and config sections for a notebook experiment.ExperimentConfig: NamedTuple returned byget_config.
ExperimentConfig
¶
Bases: NamedTuple
Resources bundled for a notebook experiment run.
Source code in src/tinycta/hyper/_setup.py
Study
dataclass
¶
Frozen wrapper around a completed Optuna study.
Source code in src/tinycta/hyper/_study.py
__str__()
¶
Return a human-readable summary of the best trial.
Source code in src/tinycta/hyper/_study.py
from_optuna(s)
classmethod
¶
Wrap a completed optuna.Study in a frozen Study.
Source code in src/tinycta/hyper/_study.py
plot(output_dir)
¶
Write Optuna visualisation plots to output_dir (HTML, PNG if kaleido available).
Source code in src/tinycta/hyper/_study.py
get_config(name, config_path=None)
¶
Return logger and config sections for an experiment.
Accepts either a shared config.yml or an experiment-specific
config/{name}.yml. Paths in the config are resolved relative to the
notebooks directory (one level above any config/ subdirectory).
NOTEBOOK_OUTPUT_FOLDER env var overrides the output directory used for
the log file sink.
Source code in src/tinycta/hyper/_setup.py
optimize(suggest_portfolio_fn, n_trials=100, seed=42)
¶
Build objective, run study, log the summary and return a frozen Study.