You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observed behavior:
When I select a categorical parameter that contains boolean values in the slice plot (first plot shown in the analytics page) then both values on the x-axis are represented as [Object object].
Expected behavior:
The plot shows the actual values, True and False on the x-axis.
Observations:
This seems a problem with optuna-dashbord and not optuna, when I create a slice plot in optuna (code below) I see the values represented correctly in the plotly graph.
I'm not familiar with React, but the problem seems to be here:
const feasibleValues = feasibleTrials.map(
(t) => selectedParamTarget.getTargetValue(t) as number
)
where the code assumes the values of the x-axis are numbers, which is not the case for boolean hyperspace parameters. I would guess that this also breaks for string values of categorical parameters.
Code to reproduce optuna plot
import optuna
from plotly.io import show
def objective(trial):
x = trial.suggest_float("x", -100, 100)
y = trial.suggest_categorical("y", [True, False])
if y:
return x**2
else:
return x*2
sampler = optuna.samplers.TPESampler(seed=10)
study = optuna.create_study(sampler=sampler)
study.optimize(objective, n_trials=10)
fig = optuna.visualization.plot_slice(study, params=["x", "y"])
show(fig)
How to Reproduce
Optuna's objective function is not relevant here, but search space needs to contain a categorical parameter that contains boolean values.
Run optuna-dashboard.
Open analytics page, then select a boolean parameter in the slice plot.
An error occurs.
Python version
3.11
Optuna version
3.6.1
optuna-dashboard version or git revision
0.16.2
Web browser
Google Chrome
The text was updated successfully, but these errors were encountered:
Description
Observed behavior:
When I select a categorical parameter that contains boolean values in the slice plot (first plot shown in the analytics page) then both values on the x-axis are represented as
[Object object]
.Expected behavior:
The plot shows the actual values,
True
andFalse
on the x-axis.Observations:
This seems a problem with optuna-dashbord and not optuna, when I create a slice plot in optuna (code below) I see the values represented correctly in the plotly graph.
I'm not familiar with React, but the problem seems to be here:
where the code assumes the values of the x-axis are numbers, which is not the case for boolean hyperspace parameters. I would guess that this also breaks for string values of categorical parameters.
Code to reproduce optuna plot
How to Reproduce
Python version
3.11
Optuna version
3.6.1
optuna-dashboard version or git revision
0.16.2
Web browser
Google Chrome
The text was updated successfully, but these errors were encountered: