hands-on lab

Tuning Hyperparameters with Hyperdrive in Azure Machine Learning

Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.
Lab description

In the world of data science, model parameters are the elements generated from training a dataset. In contrast, a hyperparameter is a parameter used to control the outcome of training the model. Machine learning models are deep and complex and require several hyperparameters to build the best model. There is no logical formula for obtaining the best hyperparameter values. These values must be tweaked and analyzed. Like tuning a musical instrument, data scientists must tune their training models to achieve the best possible outcome. 

Hyperparameter optimization can become a tedious task of tweaking values and re-running experiments. Hyperdrive is a Python package that automates this process in Azure Machine Learning. Deploying experiments with Hyperdrive dramatically reduces the process of manually tweaking the hyperparameters used for each experiment.

In this lab, you will dive into Azure Notebooks and launch a Jupyter notebook to create a Hyperdrive experiment and perform hyperparameter tuning against a regression training model.

Learning Objectives

Upon completion of this lab you will be able to:

  • Use Hyperdrive to tune hyperparameters
  • Find a model that has optimal hyperparameter values
  • Create and run Azure Notebooks
  • Manage a workspace using the Azure Machine Learning SDK

Intended Audience

This lab is intended for:

  • Individuals studying to take the Azure DP-100 exam
  • Anyone interested in learning how to use the Azure Machine Learning SDK

Lab Prerequisites

You should be familiar with:

  • Basic concepts of Azure Machine Learning
  • Experience with Python is not required but preferred


September 11th, 2023 - Updated the instructions and screenshots to reflect the latest UI

March 31st, 2022 - Updated the lab's notebook to the latest kernel and Azure ML library versions

March 1st, 2021 - Updated screenshots to match the latest Portal experience and expanded upon the definition of hyperparameters in the lab notebook

Environment before
Environment after
About the author
Luke Orellana
Cloud Labs Developer
Learning paths

Luke is a Site Reliability Engineer at Microsoft. His background is infrastructure development using Terraform and in 2021 he was awarded the HashiCorp Ambassador award. He is an Azure DevOps Engineer Expert, Azure Administrator Associate, and HashiCorp Certified - Terraform Associate.

Covered topics
Lab steps
Logging in to the Microsoft Azure Portal
Launching Azure Machine Learning Studio
Creating an Azure Notebook
Working Through the Azure Notebook