Reader small image

You're reading from  Automated Machine Learning

Product typeBook
Published inFeb 2021
Reading LevelBeginner
PublisherPackt
ISBN-139781800567689
Edition1st Edition
Languages
Right arrow
Author (1)
Adnan Masood
Adnan Masood
author image
Adnan Masood

Adnan Masood, PhD is an artificial intelligence and machine learning researcher, visiting scholar at Stanford AI Lab, software engineer, Microsoft MVP (Most Valuable Professional), and Microsoft's regional director for artificial intelligence. As chief architect of AI and machine learning at UST Global, he collaborates with Stanford AI Lab and MIT CSAIL, and leads a team of data scientists and engineers building artificial intelligence solutions to produce business value and insights that affect a range of businesses, products, and initiatives.
Read more about Adnan Masood

Right arrow

Chapter 4: Getting Started with Azure Machine Learning

"As a technologist, I see how AI and the fourth industrial revolution will impact every aspect of people's lives."

– Fei-Fei Li, Professor of Computer Science at Stanford University

In the previous chapter, you were introduced to the major AutoML Open Source Software (OSS) tools and libraries. We did a tour of the major OSS offerings, including TPOT, AutoKeras, auto-sklearn, Featuretools, and Microsoft NNI, which will have helped you, the reader, understand the differential value propositions and approaches used in each of these libraries.

In this chapter, we will start exploring the first of many commercial offerings, namely Microsoft's Azure capabilities in automated Machine Learning (ML). Azure Machine Learning is part of the Microsoft AI ecosystem, which helps accelerate the end-to-end ML life cycle using the power of the Windows Azure platform and services. We will start with an...

Getting started with Azure Machine Learning

Not so long ago, if you wanted to use ML in a production environment on the Azure platform, you needed to bring together a bunch of different services to support the full ML life cycle.

For example, to use the datasets, you would need storage repositories such as Azure Blob storage or Azure Data Lake storage. For compute, you would either need individual virtual machines, Spark clusters using HDInsight, or Azure Databricks to actually run your model code. To protect your data for enterprise readiness, you'd need to bring in your virtual networks or configure your compute and data inside the same virtual network, along with Azure Key Vault to manage and secure your credentials. In order to provide repeatability for your experiments by using a consistent set of ML libraries, and the different versions thereof, you'd create Docker containers and use Azure Container Registry to store those Docker containers. You would need to put...

The Azure Machine Learning stack

The Microsoft Azure ecosystem is quite broad; in this chapter, we will focus on its AI and ML related cloud offerings, especially the Azure Machine Learning service.

The following figure shows the offerings available for ML in the Azure cloud:

Figure 4.2 – Azure cloud ML offerings

You can visit the following link for more information about the offerings in the preceding table:

It can be confusing to know which Azure Machine Learning offering should be chosen among the many described in the preceding table. The following diagram helps with choosing the right offering based on the given business and technology scenario:

Figure 4.3 – Azure Machine Learning decision flow

Automated ML is a part of the Azure Machine Learning service capabilities. Other capabilities include collaborative notebooks, data labeling, ML operations, a drag-and-drop designer studio, autoscaling capabilities...

Getting started with the Azure Machine Learning service

In this section, we will explore a step-by-step walk-through of creating a classification model using Azure Machine Learning:

  1. Sign up for a Microsoft account, unless if you already have one, then log into the Azure Machine Learning portal at ml.azure.com. Here, you will see the ML studio as shown in the following figure. An Azure subscription is essentially the way you pay for services. You can either use your existing subscription if you have one or sign up for a new one. For a brand-new user, the nice folks at Azure offer a $200 credit to get you acquainted. Make sure to turn off the resources when you are not using them; don't leave the data center lights on:

    Figure 4.7 – Azure Machine Learning service subscription startup page

  2. In the following figure, you can see we have now been asked to select a subscription. In this case, we'll choose Free Trial to explore the services. You can also choose...

Modeling with Azure Machine Learning

Before we create an automated ML workflow, let's start with a simple Azure notebook:

  1. Azure notebooks are an integrated part of the Azure Machine Learning service, and you can either create or use a sample notebook to get started:

    Figure 4.19 – Azure Machine Learning sample notebooks

  2. In the Search to filter notebooks box in the left pane, as shown in the following figure, search for MNIST and it will filter to show you the notebooks. Select the image-classification-part1-training.ipynb file to see the notebook in the right pane, and click on Clone this notebook to create your own copy:

    Figure 4.20 – MNIST image classification notebook

  3. Click on the Clone this notebook button to clone the notebook. Cloning the notebook copies the notebook and associated configurations into your user folder as shown in the following figure. This step copies the notebooks and yml configuration files to the user directory:

    Figure 4...

Deploying and testing models with Azure Machine Learning

The model is now trained, a .pkl file has been created, and the model can be deployed for testing. The deployment part is done in the second notebook, part2-deploy.ipynb, as seen in the following figure. To deploy the model, we open up the part 2-deploy.ipynb notebook by clicking on the notebook in the left pane. We load the .pkl file by calling the joblib.Load method. You also see the run method in the following screenshot, which receives the raw JSON data, invokes the model's predict method, and returns the result:

Figure 4.41 – MNIST image classification notebook

In this step, we create a model object by calling the Model constructor as shown in the following figure. This model uses the configuration properties from the Environment object, and the service name to deploy the endpoint. This endpoint is deployed using Azure Container Instances (ACI). The endpoint location is available once...

Summary

In this chapter, you learned how to get started with the Microsoft Azure platform, the ML services ecosystem capabilities, and learned about Microsoft's AI and ML offerings. You were also briefed on different capabilities within the Azure platform, such as collaborative notebooks, drag and drop ML, MLOPS, RStudio integration, reinforcement learning, enterprise-grade security, automated ML, data labeling, autoscaling compute, integration with other Azure services, responsible ML, and cost management. Finally, to test your newly discovered Azure superpowers, you configured, built, deployed, and tested a classification web service using an Azure Machine Learning notebook.

In the next chapter, we will further dive into using the automated ML features of the Azure Machine Learning service.

Further reading

For more information on the following topics, you can visit the given links:

  • Python notebooks with ML and deep learning examples with Azure Machine Learning:

  • What are compute targets in Azure Machine Learning?

  • Use automated ML in an Azure Machine Learning pipeline in Python:

  • A critical overview of AutoML solutions by Bahador Khaleghi:

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Automated Machine Learning
Published in: Feb 2021Publisher: PacktISBN-13: 9781800567689
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Adnan Masood

Adnan Masood, PhD is an artificial intelligence and machine learning researcher, visiting scholar at Stanford AI Lab, software engineer, Microsoft MVP (Most Valuable Professional), and Microsoft's regional director for artificial intelligence. As chief architect of AI and machine learning at UST Global, he collaborates with Stanford AI Lab and MIT CSAIL, and leads a team of data scientists and engineers building artificial intelligence solutions to produce business value and insights that affect a range of businesses, products, and initiatives.
Read more about Adnan Masood