Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Azure Machine Learning Engineering

You're reading from   Azure Machine Learning Engineering Deploy, fine-tune, and optimize ML models using Microsoft Azure

Arrow left icon
Product type Paperback
Published in Jan 2023
Publisher Packt
ISBN-13 9781803239309
Length 362 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (4):
Arrow left icon
Balamurugan Balakreshnan Balamurugan Balakreshnan
Author Profile Icon Balamurugan Balakreshnan
Balamurugan Balakreshnan
Dennis Michael Sawyers Dennis Michael Sawyers
Author Profile Icon Dennis Michael Sawyers
Dennis Michael Sawyers
Sina Fakhraee Ph.D Sina Fakhraee Ph.D
Author Profile Icon Sina Fakhraee Ph.D
Sina Fakhraee Ph.D
Megan Masanz Megan Masanz
Author Profile Icon Megan Masanz
Megan Masanz
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Part 1: Training and Tuning Models with the Azure Machine Learning Service
2. Chapter 1: Introducing the Azure Machine Learning Service FREE CHAPTER 3. Chapter 2: Working with Data in AMLS 4. Chapter 3: Training Machine Learning Models in AMLS 5. Chapter 4: Tuning Your Models with AMLS 6. Chapter 5: Azure Automated Machine Learning 7. Part 2: Deploying and Explaining Models in AMLS
8. Chapter 6: Deploying ML Models for Real-Time Inferencing 9. Chapter 7: Deploying ML Models for Batch Scoring 10. Chapter 8: Responsible AI 11. Chapter 9: Productionizing Your Workload with MLOps 12. Part 3: Productionizing Your Workload with MLOps
13. Chapter 10: Using Deep Learning in Azure Machine Learning 14. Chapter 11: Using Distributed Training in AMLS 15. Index 16. Other Books You May Enjoy

Developing within AMLS

With your compute instance VM created, you can use it to write code in either R or Python. Specifically, you can code in Jupyter, JupyterLab, Visual Studio Code (VSCode), or a terminal. Both Jupyter and JupyterLab are examples of IDEs for writing Python code. VS Code is Microsoft’s recommended IDE that allows you to script in either R or Python, among many other languages.

In this section, you will begin by opening a Jupyter notebook and using it to connect to your AMLS workspace. Similarly, you will do the same thing with JupyterLab. Finally, you will learn how to use AML notebooks in order to develop code.

Developing Python code with Jupyter Notebook

Perhaps the most common way for data scientists to write code within the AMLS is through Jupyter Notebook, the most popularly used Python IDE. Jupyter Notebook does, however, come with many limitations; it lacks a lot of the most basic features of your traditional IDE, such as linting and code analysis to flag errors before you try running your code. Still, many data scientists prefer it for its streamlined, easy-to-use interface. In order to open Jupyter and create a notebook, follow these steps:

  1. Go to the AML workspace UI.
  2. Click on Compute in the left-hand navigation menu under the Manage section of the menu.

The following screenshot shows us the list of all computes created:

Figure 1.31 – List of compute instances

Figure 1.31 – List of compute instances

  1. From the list, select your compute instance and click on Start (if it has not already started). Once the compute instance has started, a link to Applications will appear.
  2. Click on the JupyterLab or Jupyter link to open the Jupyter notebook for further development.
  3. To access the AMLS workspace notebook in the left-hand menu, go to the Notebooks section.
  4. On the next screen, you should see the folders in the left-hand pane. Each user in an AMLS workspace will have a folder created for them by default. Inside your user folder, you can select a notebook to work on. Options to create folders and new notebooks are also available, as shown in Figure 1.15.

Now that you know how to use Jupyter Notebook within the AMLS, we will explore how to leverage an AML notebook.

Developing using an AML notebook

AML notebooks are similar to Jupyter notebooks and provide you with another option for developing code. Whether you choose to develop using Jupyter, JupyterLab, or AML notebooks is largely a matter of personal preference. Please try all three to determine which suits you best. In order to start developing with AML notebooks, follow the following steps:

  1. Go to the AMLS workspace UI.
  2. Click on Notebooks on the left-hand navigation menu under the Author section.
  3. Expand the folder and select your notebook or create a new notebook:
Figure 1.32 – File menu options

Figure 1.32 – File menu options

  1. Click on Create new file.
  2. Name the notebook file amlbookchapter1.ipynb.
  3. Once you click on Create, the page in Figure 1.33 should pop up. The preceding process will create a new notebook for us to start development:
Figure 1.33 – New notebook

Figure 1.33 – New notebook

In your notebook, you will see the IDE default to the Python 3.10 - SDK V2 environment. Each cell will allow you to execute code on your running compute instance.

There are two main ways to develop code within the AMLS: Jupyter and AML notebooks. However, a far more powerful IDE exists, which contains many features to improve your productivity – VS Code. In the next section, you will download VS Code and connect it to the AMLS.

You have been reading a chapter from
Azure Machine Learning Engineering
Published in: Jan 2023
Publisher: Packt
ISBN-13: 9781803239309
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.
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 $19.99/month. Cancel anytime