optuna_dashboard.SliderWidget
- class optuna_dashboard.SliderWidget(min, max, step=None, labels=None, description=None, user_attr_key=None)
A widget representing a slider for selecting a value within a range.
- Parameters:
min (float) – The minimum value of the slider.
max (float) – The maximum value of the slider.
step (Optional[float]) – The step size for the slider. Defaults to None.
labels (Optional[list[tuple[float, str]]]) – A list of tuples containing value and label for the slider. Defaults to None.
description (Optional[str]) – A description for the slider. Defaults to None.
user_attr_key (Optional[str]) – The key used by register_user_attr_form_widgets. Form output is saved as trial.user_attrs[user_attr_key]. Defaults to None.
Example
from optuna_dashboard import SliderWidget slide_widget = SliderWidget(min=0, max=10, step=1, description="Example slider")
Methods
to_dict
()Convert the SliderWidget instance to a dictionary.
Attributes
description
labels
step
user_attr_key
min
max
- to_dict()
Convert the SliderWidget instance to a dictionary.
- Returns:
A dictionary representation of the SliderWidget instance.
- Return type:
SliderWidgetJSON