From 965673c8390c7e694641bb432002c12f88565db5 Mon Sep 17 00:00:00 2001 From: contramundum53 Date: Wed, 6 Sep 2023 11:24:00 +0900 Subject: [PATCH] Update optuna_dashboard/preferential/_study.py Co-authored-by: c-bata --- optuna_dashboard/preferential/_study.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/optuna_dashboard/preferential/_study.py b/optuna_dashboard/preferential/_study.py index eeed0a5b..caa1896d 100644 --- a/optuna_dashboard/preferential/_study.py +++ b/optuna_dashboard/preferential/_study.py @@ -193,26 +193,12 @@ class PreferentialStudy: You can fix the next sampling parameters which will be evaluated in your objective function. - Example: + .. seealso:: - .. testcode:: + See `Study.enqueue_trials`_ for details. - import optuna - - - def objective(trial): - x = trial.suggest_float("x", 0, 10) - return x**2 - - - study = optuna.create_study() - study.enqueue_trial({"x": 5}) - study.enqueue_trial({"x": 0}, user_attrs={"memo": "optimal"}) - study.optimize(objective, n_trials=2) - - assert study.trials[0].params == {"x": 5} - assert study.trials[1].params == {"x": 0} - assert study.trials[1].user_attrs == {"memo": "optimal"} + .. _Study.get_trials: https://optuna.readthedocs.io/en/stable/reference/\ + generated/optuna.study.Study.html#optuna.study.Study.enqueue_trials Args: params: