-
-
Notifications
You must be signed in to change notification settings - Fork 971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow user-defined objective names in hyperparameter importance plots #4986
Allow user-defined objective names in hyperparameter importance plots #4986
Conversation
Names can be specified via `optuna.study.Study.set_metric_names`. Additionally, `_get_importances_infos` has been factored out to DRY the code a bit.
Codecov Report
@@ Coverage Diff @@
## master #4986 +/- ##
==========================================
- Coverage 89.49% 89.48% -0.01%
==========================================
Files 202 202
Lines 14910 14938 +28
==========================================
+ Hits 13343 13368 +25
- Misses 1567 1570 +3
... and 12 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@HideakiImamura @Alnusjaponica Could you review this PR? |
specific_create_study: Callable[[], Study], objective_names: list[str] | ||
) -> None: | ||
study = specific_create_study() | ||
study.set_metric_names(objective_names) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about testing the case of not setting the metric names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update! LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Motivation
Closes #4895. Names can be specified via
optuna.study.Study.set_metric_names
. Additionally,_get_importances_infos
has been factored out to DRY the code a bit.Description of the changes
study.metric_names
inplot_param_importances
to derive custom objective names._get_importances_infos
to DRY the code.Examples