optuna.create_study

optuna.create_study(storage=None, sampler=None, pruner=None, study_name=None, direction=None, load_if_exists=False, *, directions=None)[源代码]

创建一个新的 Study.

示例

import optuna


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


study = optuna.create_study()
study.optimize(objective, n_trials=3)
参数
返回

A Study object.

引发

ValueError – 如果 directions 的长度是0. 或者, 如果 direction 既不是 ‘minimize’ 也不是 maximize. 或者, 如果 directiondirections 被同时设定的话.

返回类型

optuna.study.Study