Repository navigation
Restore infeasible trial markers in plot_contour matrices - #6934
Conversation
|
Could you add a minimal reproducible example (code and the resulting plot) showing the missing infeasible markers in a contour matrix? Please clarify which panels change; a before-and-after plot would help. |
|
hey @c-bata , I reproduced this with a small random forest study under a model-size limit. here's a smaller repro. import optuna
def objective(trial):
x = trial.suggest_float("x", 0, 1)
y = trial.suggest_float("y", 0, 1)
z = trial.suggest_float("z", 0, 1)
trial.set_constraint("x <= y", x - y)
return x + y + z
study = optuna.create_study()
for x, y, z in [(0, 0, 0), (0.75, 0.25, 0.75), (0, 1, 1), (1, 1, 0)]:
study.enqueue_trial({"x": x, "y": y, "z": z})
study.optimize(objective, n_trials=4)
figure = optuna.visualization.plot_contour(study, params=["x", "y", "z"])
figure.update_layout(width=900, height=900)
figure.show()The fix adds the gray marker to all six off-diagonal panels, the two-parameter plot, contours and diagonal panels stay the same.
here's a cropped panel from the model-size study. five trials fit the 256 KiB budget and seven exceeded it. the fix restores those seven over-budget trial markers.
|
|
@yen-0 @kAIto47802 Could you review this PR? |
yen-0
left a comment
There was a problem hiding this comment.
LGTM. The fix restores infeasible-trial markers in every off-diagonal contour-matrix panel, and the regression test verifies behavior.


Motivation
For constrained studies with three or more parameters,
plot_contouromits the gray markers for infeasible trials. The same observations appear when plotting two parameters. The subplot helper already returns the infeasible scatter, but the matrix branch adds only the contour and feasible scatter.Description of the changes
Blast radius
Only Plotly contour-matrix assembly changes. Each off-diagonal panel gains a scatter trace, including an empty trace for all-feasible data, so positional
figure.dataindexes change. Contour values, axis and colorbar settings, stored trials, optimization, the two-parameter path, and Matplotlib behavior remain unchanged.Validation
git diff --checkpass.The contour suite retains its existing Matplotlib open-figure warning. The full repository suite and browser rendering were not run locally.
Checklist