Storages¶
-
class
optuna.storages.
RDBStorage
(url, engine_kwargs=None, skip_compatibility_check=False)[source]¶ Storage class for RDB backend.
Note that library users can instantiate this class, but the attributes provided by this class are not supposed to be directly accessed by them.
Example
We create an
RDBStorage
instance with customizedpool_size
andmax_overflow
settings.>>> import optuna >>> >>> def objective(trial): >>> ... >>> >>> storage = optuna.storages.RDBStorage( >>> url='postgresql://foo@localhost/db', >>> engine_kwargs={ >>> 'pool_size': 20, >>> 'max_overflow': 0 >>> } >>> ) >>> >>> study = optuna.create_study(storage=storage) >>> study.optimize(objective)
Parameters: - url – URL of the storage.
- engine_kwargs – A dictionary of keyword arguments that is passed to sqlalchemy.engine.create_engine function.