Skip to content
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

Add helper method to get best HyperparameterTuningJob trial #1545

Open
zchenyu opened this issue Jul 28, 2022 · 1 comment
Open

Add helper method to get best HyperparameterTuningJob trial #1545

zchenyu opened this issue Jul 28, 2022 · 1 comment
Labels
api: vertex-ai Issues related to the googleapis/python-aiplatform API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@zchenyu
Copy link

zchenyu commented Jul 28, 2022

Currently there's no way to get the best trial from a HyperparameterTuningJob besides inspecting each individual trial and implementing minimization or maximization (depending on the study config).

It would be nice if we had a helper method like HPTuningJob.best_trial() or HPTuningJob.best_trials(n)

Or just sorting the trials returned by trials() might be sufficient.

@product-auto-label product-auto-label bot added the api: vertex-ai Issues related to the googleapis/python-aiplatform API. label Jul 28, 2022
@meredithslota meredithslota added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Aug 5, 2022
@jaycee-li jaycee-li self-assigned this Aug 10, 2022
@jaycee-li
Copy link
Contributor

Hi @zchenyu ,

There could be multiple metrics for each trial, so the helper method needs several more fields E.g,HPTuningJob.best_trials(num_trials=10, metric_id='accuracy', goal='maximize')

An alternative approach is to add a HPTuningJob.get_trails_df() method which returns all the trials' ids, training steps, params, and metrics in a pandas DataFrame (like what we show in cloud console UI. In this case users can easily sort/filter by every param or metric.

Which option do your prefer?

@jaycee-li jaycee-li removed their assignment Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: vertex-ai Issues related to the googleapis/python-aiplatform API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants