create_study(storage: Union[None, str, storages.BaseStorage] = None, sampler: samplers.BaseSampler = None, pruner: pruners.BasePruner = None, study_name: Optional[str] = None, direction: str = 'minimize', load_if_exists: bool = False) → Study¶
Create a new
Database URL. If this argument is set to None, in-memory storage is used, and the
Studywill not be persistent.
When a database URL is passed, Optuna internally uses SQLAlchemy to handle the database. Please refer to SQLAlchemy’s document for further details. If you want to specify non-default options to SQLAlchemy Engine, you can instantiate
RDBStoragewith your desired options and pass it to the
storageargument instead of a URL.
pruner – A pruner object that decides early stopping of unpromising trials. See also
study_name – Study’s name. If this argument is set to None, a unique name is generated automatically.
direction – Direction of optimization. Set
minimizefor minimization and
load_if_exists – Flag to control the behavior to handle a conflict of study names. In the case where a study named
study_namealready exists in the
DuplicatedStudyErroris raised if
load_if_existsis set to
False. Otherwise, the creation of the study is skipped, and the existing one is returned.