optuna.get_all_study_summaries

optuna.get_all_study_summaries(storage, include_best_trial=True)[source]

Get all history of studies stored in a specified storage.

Example

import optuna


def objective(trial):
    x = trial.suggest_float("x", -10, 10)
    return (x - 2) ** 2


study = optuna.create_study(study_name="example-study", storage="sqlite:///example.db")
study.optimize(objective, n_trials=3)

study_summaries = optuna.study.get_all_study_summaries(storage="sqlite:///example.db")
assert len(study_summaries) == 1

study_summary = study_summaries[0]
assert study_summary.study_name == "example-study"
Parameters
  • storage (Union[str, BaseStorage]) – Database URL such as sqlite:///example.db. Please see also the documentation of create_study() for further details.

  • include_best_trial (bool) – Include the best trials if exist. It potentially increases the number of queries and may take longer to fetch summaries depending on the storage.

Returns

List of study history summarized as StudySummary objects.

Return type

List[StudySummary]