optuna.study.create_study

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

Create a new 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 – If the length of directions is zero. Or, if direction is neither ‘minimize’ nor ‘maximize’ when it is a string. Or, if the element of directions is neither minimize nor maximize. Or, if both direction and directions are specified.

返回类型

optuna.study.Study