optuna_dashboard.register_user_attr_form_widgets
- optuna_dashboard.register_user_attr_form_widgets(study, widgets)
Register a list of form widgets to an Optuna study.
Submitted values to the forms are registered as each trial’s user_attrs.
- Parameters:
study (Study) – The Optuna study object to register the form widgets for.
widgets (list[ChoiceWidget | SliderWidget | TextInputWidget | ObjectiveUserAttrRef]) – A list of ObjectiveFormWidget objects to be registered in the study.
- Raises:
ValueError – If an ObjectiveUserAttrRef is specified or if user_attr_key is not specified.
ValueError – If user_attr_key is not unique for each widget.
- Return type:
None
Examples
import optuna from optuna_dashboard import ChoiceWidget, SliderWidget from optuna_dashboard import register_user_attr_form_widgets study = optuna.create_study() register_user_attr_form_widgets( study, widgets=[ ChoiceWidget( choices=["Good 👍", "Bad 👎"], values=[-1, 1], description="Please input your score!", user_attr_key="hitl/choice", ), SliderWidget( min=1, max=10, step=1, description="Higher is better.", user_attr_key="hitl/slider", ), ], )