optuna_dashboard.preferential.create_study

optuna_dashboard.preferential.create_study(*, n_generate, storage=None, sampler=None, study_name=None, load_if_exists=False)

Like optuna.create_study(), but for preferential optimization.

Example

import optuna
from optuna_dashboard.preferential import create_study


study = create_study()
trial = study.ask()
Parameters:
  • n_generate (int) – The number of active trials to keep. should_generate() returns True if the number of trials not reported bad and not skipped are less than n_generate.

  • storage (str | BaseStorage | None) – Database URL. If this argument is set to None, in-memory storage is used, and the PreferentialStudy will not be persistent.

  • sampler (BaseSampler | None) – A sampler object that implements background algorithm for value suggestion. If None is specified, PreferentialGPSampler is used. Please note that most Optuna samplers does not work efficiently for preferential optimization.

  • study_name (str | None) – Study’s name. If this argument is set to None, a unique name is generated automatically.

  • load_if_exists (bool) – Flag to control the behavior to handle a conflict of study names. In the case where a study named study_name already exists in the storage, a DuplicatedStudyError is raised if load_if_exists is set to False. Otherwise, the creation of the study is skipped, and the existing one is returned.

Returns:

A PreferentialStudy object.

Return type:

PreferentialStudy

Note

Preferential optimization is an experimental feature (introduced in v0.13.0). The interface may change in newer versions without prior notice.