Practical Machine Learning with AWS: Process, Build, Deploy, and Productionize Your Models Using AWS
()
About this ebook
This book is divided into three parts. Part I introduces basic cloud concepts and terminologies related to AWS services such as S3, EC2, Identity Access Management, Roles, Load Balancer, and Cloud Formation. It also covers cloud security topics such as AWS Compliance and artifacts, and the AWS Shield and CloudWatch monitoring service built for developers and DevOps engineers. Part II covers machine learning in AWS using SageMaker, which gives developers and data scientists the ability to build, train, and deploy machine learning models. Part III explores other AWS services such as Amazon Comprehend (a natural language processing service that uses machine learning to find insights and relationships in text), Amazon Forecast (helps you deliver accurate forecasts), and Amazon Textract.
By the end of the book, you will understand the machine learning pipeline and how to execute any machine learning model using AWS. The book will also help you prepare for the AWS Certified Machine Learning—Specialty certification exam.
What You Will Learn
- Be familiar with the different machine learning services offered by AWS
- Understand S3, EC2, Identity Access Management, and Cloud Formation
- Understand SageMaker, Amazon Comprehend, and Amazon Forecast
- Execute live projects: from the pre-processing phase to deployment on AWS
Who This Book Is For
Machine learning engineers who want to learn AWS machine learning services, and acquire an AWS machine learning specialty certification
Read more from Himanshu Singh
Statistics for Machine Learning: Implement Statistical methods used in Machine Learning using Python (English Edition) Rating: 0 out of 5 stars0 ratingsDeep Neuro-Fuzzy Systems with Python: With Case Studies and Applications from the Industry Rating: 0 out of 5 stars0 ratingsPractical Machine Learning and Image Processing: For Facial Recognition, Object Detection, and Pattern Recognition Using Python Rating: 0 out of 5 stars0 ratings
Related to Practical Machine Learning with AWS
Related ebooks
Serverless Architectures with AWS: Discover how you can migrate from traditional deployments to serverless architectures with AWS Rating: 0 out of 5 stars0 ratingsIntroduction to Amazon AWS Rating: 0 out of 5 stars0 ratingsMastering AWS CloudFormation: Build resilient and production-ready infrastructure in Amazon Web Services with CloudFormation Rating: 0 out of 5 stars0 ratingsAWS Solution Architect Certification Exam Practice Paper 2019 Rating: 4 out of 5 stars4/5Step by Step: Fault-tolerant, Scalable, Secure AWS Web Stack Rating: 0 out of 5 stars0 ratingsAWS for System Administrators: Build, automate, and manage your infrastructure on the most popular cloud platform – AWS Rating: 0 out of 5 stars0 ratingsMachine Learning Engineering on AWS: Build, scale, and secure machine learning systems and MLOps pipelines in production Rating: 0 out of 5 stars0 ratingsLearn Amazon SageMaker: A guide to building, training, and deploying machine learning models for developers and data scientists Rating: 0 out of 5 stars0 ratingsPython Essentials for AWS Cloud Developers: Run and deploy cloud-based Python applications using AWS Rating: 0 out of 5 stars0 ratingsComputer Vision on AWS: Build and deploy real-world CV solutions with Amazon Rekognition, Lookout for Vision, and SageMaker Rating: 0 out of 5 stars0 ratingsAWS Certified Cloud Practitioner - Practice Paper 2: AWS Certified Cloud Practitioner, #2 Rating: 5 out of 5 stars5/5Mastering Amazon Web Services: Essential AWS Techniques Rating: 0 out of 5 stars0 ratingsAWS FinOps Simplified: Eliminate cloud waste through practical FinOps Rating: 0 out of 5 stars0 ratingsKubernetes on AWS: Deploy and manage production-ready Kubernetes clusters on AWS Rating: 0 out of 5 stars0 ratingsAWS Lambda Quick Start Guide: Learn how to build and deploy serverless applications on AWS Rating: 0 out of 5 stars0 ratingsHands-on Azure Functions with C#: Build Function as a Service (FaaS) Solutions Rating: 0 out of 5 stars0 ratingsRunning Windows Containers on AWS: A complete guide to successfully running Windows containers on Amazon ECS, EKS, and AWS Fargate Rating: 0 out of 5 stars0 ratingsAutomated Machine Learning with Microsoft Azure: Build highly accurate and scalable end-to-end AI solutions with Azure AutoML Rating: 0 out of 5 stars0 ratingsAWS: Security Best Practices on AWS: Learn to secure your data, servers, and applications with AWS Rating: 0 out of 5 stars0 ratingsAWS Administration – The Definitive Guide Rating: 0 out of 5 stars0 ratingsLearn Microsoft Azure: Step by Step in 7 day for .NET Developers Rating: 0 out of 5 stars0 ratingsAmazon Web Services: Migrating your .NET Enterprise Application Rating: 0 out of 5 stars0 ratingsAWS Cloud Practitioner: From Basic to Advanced Rating: 0 out of 5 stars0 ratings
Intelligence (AI) & Semantics For You
Mastering ChatGPT: 21 Prompts Templates for Effortless Writing Rating: 4 out of 5 stars4/5Artificial Intelligence: A Guide for Thinking Humans Rating: 4 out of 5 stars4/52084: Artificial Intelligence and the Future of Humanity Rating: 4 out of 5 stars4/5Summary of Super-Intelligence From Nick Bostrom Rating: 4 out of 5 stars4/5Nexus: A Brief History of Information Networks from the Stone Age to AI Rating: 4 out of 5 stars4/5ChatGPT For Fiction Writing: AI for Authors Rating: 5 out of 5 stars5/5The Secrets of ChatGPT Prompt Engineering for Non-Developers Rating: 5 out of 5 stars5/5Coding with AI For Dummies Rating: 0 out of 5 stars0 ratingsOur Final Invention: Artificial Intelligence and the End of the Human Era Rating: 4 out of 5 stars4/5Chat-GPT Income Ideas: Pioneering Monetization Concepts Utilizing Conversational AI for Profitable Ventures Rating: 3 out of 5 stars3/5ChatGPT For Dummies Rating: 4 out of 5 stars4/5Midjourney Mastery - The Ultimate Handbook of Prompts Rating: 5 out of 5 stars5/5AI for Educators: AI for Educators Rating: 5 out of 5 stars5/5Writing AI Prompts For Dummies Rating: 0 out of 5 stars0 ratingsCreating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5Artificial Intelligence For Dummies Rating: 3 out of 5 stars3/5Make Money with ChatGPT: Your Guide to Making Passive Income Online with Ease using AI: AI Wealth Mastery Rating: 0 out of 5 stars0 ratings100M Offers Made Easy: Create Your Own Irresistible Offers by Turning ChatGPT into Alex Hormozi Rating: 0 out of 5 stars0 ratingsThe Roadmap to AI Mastery: A Guide to Building and Scaling Projects Rating: 3 out of 5 stars3/5Dark Aeon: Transhumanism and the War Against Humanity Rating: 5 out of 5 stars5/5Killer ChatGPT Prompts: Harness the Power of AI for Success and Profit Rating: 2 out of 5 stars2/5
Reviews for Practical Machine Learning with AWS
0 ratings0 reviews
Book preview
Practical Machine Learning with AWS - Himanshu Singh
Part IIntroduction to Amazon Web Services
© Himanshu Singh 2021
H. SinghPractical Machine Learning with AWS https://doi.org/10.1007/978-1-4842-6222-1_1
1. Cloud Computing and AWS
Himanshu Singh¹
(1)
ALLAHABAD, Uttar Pradesh, India
This chapter covers the different components of cloud computing and of Amazon Web Services (AWS). After reading the chapter, you’ll understand the different important components of AWS, which will make it easier to understand the machine learning components of AWS.
What Is the Cloud?
So, what is the cloud? If you look at memes shared across the internet, you might think the cloud is nothing but someone else’s computer that you can use from your own computing device, for your own personal use. Then the question arises, why do we need the other computer when we have our own? It’s because our computer may not have things that the other system has. Maybe your budget when buying a system was less than the other person’s, and he therefore has more computational power to use. So, instead of buying a new system with more computational power, you can just access the other system for some amount of time and then return to your own system. This is the benefit that the cloud provides. And, by the way, we all know the other system is not just any normal system. Cloud systems are provided by big companies such as Amazon and Google. So even if you are trying to buy a new system with as much computational power as cloud systems, you will not be able to afford it.
Formally speaking, the cloud is a particular computing service that is present at a different remote location that we can access using networking or the internet. Cloud services may include storage services, infrastructure services, software services, or any other specific services that you need. Figure 1-1 shows how different devices are connected to cloud systems at a remote location.
../images/495447_1_En_1_Chapter/495447_1_En_1_Fig1_HTML.jpgFigure 1-1
How different devices are connected to cloud systems at a remote location
If we are able to access any of the services present at the remote location using the internet or networking, then we call this cloud computing.
Control of Cloud Systems
Obviously, if someone is allowing access to use their personal system over the internet, then they may want to restrict access in some ways. Or, they may want one group of people to have full access, but another group to have limited access. This is done to avoid security issues and not expose the vulnerabilities present in the system. To solve this problem, cloud computing comes in four types.
Public cloud
Private cloud
Hybrid cloud
Community cloud
Public Cloud
When the entire cloud infrastructure is open for public consumption, then it is called a public cloud. Examples are the email services provided by Google or Yahoo.
Private Cloud
When only a specific group of people can access the services provided by a cloud, then it is called a private cloud. An example is when people in an organization can access the resources present in the organization’s cloud, but no one from outside the organization can access the same resources.
Community Cloud
When a cloud service is accessible to a group of organizations, then it is called a community cloud. For example, different organizations can access the services of AWS or the Google Cloud Platform by registering. So, the same services are available to all the organizations that have paid for it, but not to anyone else.
Hybrid Cloud
When a cloud service provides both options (i.e., services of a public and private cloud), then it is termed a hybrid cloud. An example is using two services of AWS. When we train a model using SageMaker training, it is a private task for specific organizations because it contains sensitive data and other things, but when we train a model and then share the endpoint publicly, it is a public cloud because whoever has the link can access that endpoint. (You’ll learn more about SageMaker in later chapters.)
Cloud Services
Now that you have learned about the different ways of accessing a cloud, let’s dive deeper and look at the services that a cloud platform may provide. We can group these services into four domains.
Infrastructure as a service (IaaS)
Platform as a service (PaaS)
Software as a service (SaaS)
Anything as a service (XaaS)
Infrastructure as a Service
As the name suggests, when a cloud service provider gives access to users to the infrastructure that it has built, it is considered an IaaS. For example, a cloud provider may give access to virtual machines, physical machines, storage devices, etc. For example, we can use Google Drive to store information on the cloud, since Google is providing its hard drives as a service. AWS also provides machines called EC2 instances that individuals can use to do operations that require higher computational power.
Platform as a Service
Sometimes, instead of requiring an entire infrastructure, we want only a specific development runtime where we can write our code or make games or websites. This way the cost of building an entire infrastructure can be reduced. This type of service is a PaaS. For example, we can use Google Colaboratory for writing Python or R code. In addition, we can use AWS SageMaker to train and put a machine learning model into production. There are other service providers as well such as Microsoft Azure, Google Cloud Platform, IBM Cloud, etc.
Software as a Service
When we don’t want the runtime, but we want to use a specific software application with its built-in runtime, we don’t need a PaaS, which would give us the runtime as well as dependencies and software we’d need to install. Hence, there are cloud services that provide specific software for specific uses, called SaaS. Examples of SaaS are Amazon Ground Truth, which is used for data management, and Office 365 by Microsoft.
Anything as a Service
The first three types of services have been on the market for quite some time, but now, because of the advancement in technology, cloud service providers are providing almost anything as a cloud service. For example, we can now draw sketches of web pages and give them to Azure, which converts them into HTML pages. In addition, you can play online songs by just talking to Alexa, which is connected to AWS. All this comes under the umbrella of XaaS.
Let’s now dive deeper into a specific cloud service provider, called Amazon Web Services (AWS).
Introduction to Amazon Web Services
AWS provides global cloud computing services across many countries and is currently responsible for handling the infrastructure of many companies, including small and large enterprises. According to the AWS documentation, currently AWS caters to hundreds of thousands of businesses in 190 countries.
AWS provides more than 150 services that can be used on demand and can be paid for based on the time used. Currently, AWS has data servers in a lot of regions, and you can choose to use only one region’s server that is closest to your users. The following is the list of data servers across the globe:
North America
Ohio (US East)
Oregon (US West)
Northern California (US West)
Northern Virginia (US West)
Gov Cloud (US East and US West)
Canada (Central)
South America
Sao Paulo
Europe/Middle East/Africa
London (Europe)
Stockholm (Europe)
Frankfurt (Europe)
Paris (Europe)
Bahrain (Middle East)
Ireland (Europe)
Asia Pacific
Singapore (Asia Pacific)
Beijing (Mainland China)
Sydney (Asia Pacific)
Tokyo (Asia Pacific)
Seoul (Asia Pacific)
Ningxia (Mainland China)
Osaka (Asia Pacific)
Mumbai (Asia Pacific)
Hong Kong (Asia Pacific)
As I mentioned, AWS has more than 150 services. The question is, how do you access them? Is there a single centralized place from where they can be accessed? Well, yes! This place is called the AWS Management Console. Let’s look at some of the features of this console and how it is really helpful to users.
AWS Management Console
With the AWS Management Console (AMC), not only can you access the services, but it provides some other cool features as well. Some of them are as follows:
Once you have created an account on AWS and logged in to AMS, then your session remains active only for 12 hours. After that, you need to log in again. Obviously, this time limit is customizable. This feature is provided for security reasons.
Not only can you access AMS from the Web, but you can use the mobile app as well. The AMS app is present both on IOS and on Android devices.
AMS provides access to different learning resources, articles, documentation, videos, etc., which help us in understanding the different services of AWS.
You can even customize and personalize AMS based on your usage and needs.
After logging in to AWS, you will see the following features:
Search button to find specific services
Recently visited services by a user
List of all the services
Links to automated workflows
Link to learning resources
Figures 1-2, 1-3, 1-4, and 1-5 show the different screens of AMS.
../images/495447_1_En_1_Chapter/495447_1_En_1_Fig2_HTML.jpgFigure 1-2
Find Services feature and recently visited services on AMS
../images/495447_1_En_1_Chapter/495447_1_En_1_Fig3_HTML.jpgFigure 1-3
Learning resources on AMS
../images/495447_1_En_1_Chapter/495447_1_En_1_Fig4_HTML.jpgFigure 1-4
Automation on AMS
../images/495447_1_En_1_Chapter/495447_1_En_1_Fig5_HTML.jpgFigure 1-5
List of all services on AMS
We will look at how to log in to AWS and visit AMS in detail in the next section about machine learning. Now, let’s move to the next feature of AWS called the AWS Command-Line Interface (AWS CLI).
AWS Command-Line Interface
If AMC gives you a visual interface to access the AWS services, the CLI gives you some advanced power to access the same services through the console. It is used by advanced developers who have spent some time with AWS. You just need to download a single tool, and then you can use it to control different services, write scripts, and have control over the automation of services.
AWS provides a lot of resources such as reference documents, GitHub repositories, forums, etc., for understanding AWS CLI. Though one can use AWS CLI from the default console such as the command prompt of Windows or terminals of Linux and Mac, there is a dedicated AWS shell that provides some advanced functionalities. Some of them are as follows:
Autocompletion support
Inline documentation of commands
OS shell commands, which can also be executed from the same shell
We will be using the CLI a lot when we will cover machine learning in detail. Therefore, we will look at its practical aspects directly in that section.
Because AWS provides so many services, covering all of them is not possible in one book. Moreover, this book is about machine learning, so it doesn’t make any sense to cover every service here. But, we will discuss three services that I think are really important and commonly used. The following are the services that we are going to discuss here:
AWS Storage Services
AWS Compute Services
AWS Networking and Content Delivery Services
Let’s start the discussion with the first one, Storage Services.
AWS Storage Services
When we work on a cloud platform and use its services, obviously we’ll have a lot of data depending on the requirements. For example, if we are building a website, then we will have images, videos, and lots of other things to store. If we have a machine learning model, then we will have terabytes of data to handle. This data can be both structured and unstructured. Similarly, for business purposes, we can have multiple Excel sheets or presentations. All these data types must be stored somewhere in the cloud, and the cloud platform should provide this facility.
AWS provides a lot of options for data storage, and we’ll discuss three of them in this section.
Amazon S3
Amazon Elastic File System (EFS)
AWS Storage Gateway
Amazon S3
One of the most used services of AWS is Amazon Simple Storage System (S3). It provides you with an interface where you can store your data in a similar way to how you store it in your local file system. You can create folders and multiple subdirectories to organize your data. The following are some of the basic features Amazon S3 provides:
It provides scalability, which is currently leading in the industry.
It provides real-time data availability.
It provides security and optimized performance.
It has a durability of 99.9999999… percent (11 nines).
S3 is really simple to use. First let’s understand some of the naming conventions used by Amazon S3.
Buckets
A bucket is just like a folder in your local file system. It is a container used for storing your files.
Objects
The files that you store in S3 are termed objects. All the objects are stored inside the buckets.
Keys
Every object that you store will be given a unique identifier called a key. Also, not only objects but buckets are provided with unique keys.
Does S3 only provide simple storage, as its name suggests? I will say yes and no. Yes, because its main use is storage only, and it is really simple. No, because it has lots of other features revolving around the storage feature that make it a go-to service for every customer. Let’s see what those features are that make S3 so powerful.
Based on how frequently data