Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
The Machine Learning Solutions Architect Handbook - Second Edition

You're reading from  The Machine Learning Solutions Architect Handbook - Second Edition

Product type Book
Published in Apr 2024
Publisher Packt
ISBN-13 9781805122500
Pages 602 pages
Edition 2nd Edition
Languages
Author (1):
David Ping David Ping
Profile icon David Ping

Table of Contents (19) Chapters

Preface Navigating the ML Lifecycle with ML Solutions Architecture Exploring ML Business Use Cases Exploring ML Algorithms Data Management for ML Exploring Open-Source ML Libraries Kubernetes Container Orchestration Infrastructure Management Open-Source ML Platforms Building a Data Science Environment Using AWS ML Services Designing an Enterprise ML Architecture with AWS ML Services Advanced ML Engineering Building ML Solutions with AWS AI Services AI Risk Management Bias, Explainability, Privacy, and Adversarial Attacks Charting the Course of Your ML Journey Navigating the Generative AI Project Lifecycle Designing Generative AI Platforms and Solutions Other Books You May Enjoy
Index

Building a Data Science Environment Using AWS ML Services

While some organizations opt to build their own ML platforms using open-source technologies, many other organizations prefer to leverage fully managed ML services as the foundation for their ML platforms. In this chapter, we will delve into the fully managed ML services offered by AWS. Specifically, you will learn about Amazon SageMaker, and other related services for building a data science environment for data scientists. We will examine various components of SageMaker, such as SageMaker Studio, SageMaker Training, and SageMaker Hosting. Additionally, we will delve into the architectural framework for constructing a data science environment and provide a hands-on exercise to guide you through the process.

In a nutshell, this chapter will cover the following topics:

  • SageMaker overview
  • Data science environment architecture using SageMaker
  • Best practices for building a data science environment
  • ...

Technical requirements

In this chapter, you will need access to an AWS account and have the following AWS services for the hands-on lab:

  • Amazon S3
  • Amazon SageMaker
  • Amazon ECR

You will also need to download the dataset from https://www.kaggle.com/ankurzing/sentiment-analysis-for-financial-news.

The sample source code used in this chapter can be found at https://github.com/PacktPublishing/The-Machine-Learning-Solutions-Architect-and-Risk-Management-Handbook-Second-Edition/tree/main/Chapter08.

SageMaker overview

Amazon SageMaker offers ML functionalities that cover the entire ML lifecycle, spanning from initial experimentation to production deployment and ongoing monitoring. It caters to various roles, such as data scientists, data analysts, and MLOps engineers. The following diagram showcases the key SageMaker features that support the complete data science journey for different personas:

A screenshot of a computer  Description automatically generated

Figure 8.1: SageMaker capabilities

Within SageMaker, data scientists have access to an array of features and services to support different ML tasks. These include Studio notebooks for model building, Data Wrangler for visual data preparation, the Processing service for large-scale data processing and transformation, the Training service, the Tuning service for model tuning, and the Hosting service for model hosting. With these tools, data scientists can handle various ML responsibilities, such as data preparation, model building and training, model tuning, and conducting...

Data science environment architecture using SageMaker

Data scientists use data science environments to iterate different data science experiments with various datasets and algorithms. These environments require essential tools like Jupyter Notebook to author and execute code, data processing engines for handling large-scale data processing and feature engineering, and model training services for training models at scale. Additionally, an effective data science environment should include utilities for managing and tracking different experimentation runs, enabling researchers to organize and monitor their experiments effectively. To manage artifacts such as source code and Docker images, the data scientists also need a code repository and a Docker container repository.

The following diagram illustrates a basic data science environment architecture that uses Amazon SageMaker and other supporting services:

Figure 8.1 – Data science environment architecture

Figure 8.2: Data science environment architecture

SageMaker has...

Best practices for building a data science environment

Data science environments are meant for data scientists to perform quick experimentations using a wide range of ML frameworks and libraries. The following are some best practices to follow when providing such an environment for your data scientists:

  • Run large-scale model training using the SageMaker Training service instead of Studio notebooks: SageMaker Studio notebooks are meant for quick experimentation with small datasets. While it is possible to provision large EC2 instances for certain large model training jobs, it is not cost effective to always keep a large EC2 instance running for a notebook all the time.
  • Abstract infrastructure configuration details from data scientists: There are many infrastructure configurations to consider when using SageMaker, such as networking configuration, IAM roles, encryption keys, EC2 instance types, and storage options. To make the lives of data scientists easier, abstract...

Hands-on exercise – building a data science environment using AWS services

The primary goal of this lab is to offer practical, hands-on experience with the various SageMaker tools. Once you are familiar with the core functionality in this lab, you should independently explore other features such as Code Editor and RStudio.

Problem statement

As an ML solutions architect, you have been tasked with building a data science environment on AWS for the data scientists in the equity research department. The data scientists in the equity research department have several NLP problems, such as detecting the sentiment of financial phrases. Once you have created the environment for the data scientists, you also need to build a proof of concept to show the data scientists how to build and train an NLP model using the environment.

Dataset description

The data scientists have indicated that they like to use the BERT model to solve sentiment analysis problems, and they plan...

Summary

In this chapter, we explored how a data science environment can provide a scalable infrastructure for experimentation, model training, and model deployment for testing purposes. You learned about the core architecture components for building a fully managed data science environment using AWS services such as Amazon SageMaker, Amazon ECR, and Amazon S3. You practiced setting up a data science environment and trained and deployed an NLP model using both SageMaker Studio notebooks and the SageMaker Training service. You have also developed hands-on experience with SageMaker Canvas to automate ML tasks from model building to model deployment.

At this point, you should be able to talk about the key components of a data science environment, as well as how to build one using AWS services and use it for model building, training, and deployment. In the next chapter, we will talk about how to build an enterprise ML platform for scale through automation.

Join our community on...

lock icon The rest of the chapter is locked
You have been reading a chapter from
The Machine Learning Solutions Architect Handbook - Second Edition
Published in: Apr 2024 Publisher: Packt ISBN-13: 9781805122500
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 $15.99/month. Cancel anytime}