Skip to content

Handle studies without hyperparameters in the importance API - #1380

Closed
Boulea7 wants to merge 2 commits into
optuna:mainfrom
Boulea7:fix/no-parameter-importance
Closed

Boulea7 wants to merge 2 commits into
optuna:mainfrom
Boulea7:fix/no-parameter-importance

Conversation

@Boulea7

@Boulea7 Boulea7 commented Dec 3, 2026

Copy link
Copy Markdown

Contributor License Agreement

  • I agree this patch may be ported to Goptuna by other Goptuna contributors.

Reference Issues/PRs

Related to #1334, which keeps the dedicated parameter importance API for the web plot.

What does this implement/fix?

Run this with Optuna, then open the study using optuna-dashboard sqlite:///no-params.db.

import optuna

study = optuna.create_study(storage="sqlite:///no-params.db")
study.optimize(lambda trial: float(trial.number), n_trials=3)

Opening the study shows “Failed to load hyperparameter importance” because the API divides by an empty search space.

Return an empty importance list per objective when the search space is empty. The existing uniform fallback still applies when parameters are present.

Verified single- and multi-objective API responses, the study page on SQLite in Chromium, and a one-parameter control.

@c-bata

c-bata commented Dec 4, 2026

Copy link
Copy Markdown
Member

Let me close this PR since I have a plan to integrate with Rustuna's JS binding to calculate hyperparameter importances that makes this JSON API no longer needed.

@c-bata c-bata closed this Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants