question

AdrianCartier-4813 avatar image
0 Votes"
AdrianCartier-4813 asked YutongTie-MSFT answered

Azure ML Hyperdrive

When running the hyperdrive step, I would like to get the hyper parameters that were selected for the best model and export them to use in a subsequent model. How would I got about doing that? I saw a method get_hyperparameters but from what I can tell that just gets all child runs. I am essentially wanting to use the same model but change alpha levels.

azure-machine-learning
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

YutongTie-MSFT avatar image
0 Votes"
YutongTie-MSFT answered

Hello.

I think below is what you are looking for. Could you please take a look?

Once all of the hyperparameter tuning runs have completed, identify the best performing configuration and hyperparameter values:

 best_run = hyperdrive_run.get_best_run_by_primary_metric()
 best_run_metrics = best_run.get_metrics()
 parameter_values = best_run.get_details()['runDefinition']['Arguments']
    
 print('Best Run Id: ', best_run.id)
 print('\n Accuracy:', best_run_metrics['accuracy'])
 print('\n learning rate:',parameter_values[3])
 print('\n keep probability:',parameter_values[5])
 print('\n batch size:',parameter_values[7])



Regards,
Yutong

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you. I will give this a look and report back if any issues arise.

1 Vote 1 ·

Yuton,

That appears to have been the trick. Thanks for your help

0 Votes 0 ·

@AdrianCartier-4813 Could you please accept the answer to help the community? Thanks!!!

Regards,
Yutong

0 Votes 0 ·