You are on page 1of 48

AW S A c a d e m y M a c h i n e L e a r n i n g F o u n d a t i o n s

Module 2: Introduction to Machine


Learning

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Module overview

Sections Demonstration
Introducing Amazon SageMaker
1. What is machine learning?
2. Business problems solved with
machine learning
3. Machine learning process
4. Machine learning tools overview
5. Machine learning challenges
Knowledge check

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 2
Module objectives

At the end of this module, you should be able to:


• Recognize how machine learning and deep learning are part of artificial intelligence
• Describe artificial intelligence and machine learning terminology
• Identify how machine learning can be used to solve a business problem
• Describe the machine learning process
• List the tools available to data scientists
• Identify when to use machine learning instead of traditional software development
methods

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 3
Module 2: Introduction to Machine Learning

Section 1: What is machine learning ?

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Artificial intelligence, machine learning, and
deep learning

Artificial intelligence

Machine learning

Deep learning

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 5
Artificial intelligence

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 6
Machine learning

Machine learning is the scientific study of algorithms and statistical models to


perform a task using inference instead of instructions.

Data Model Prediction

Machine learning flow

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 7
Deep learning

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 8
ML and technology advancements

Traditional Cloud computing and Modern machine


computing Moore’s law learning

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 9
• Artificial intelligence
Section 1 key • Machines performing human tasks
takeaways • Machine learning
• Training models to make predictions
• Deep learning
• Neural networks
• Technology and economic
advancements have made machine
learning more accessible to
individuals and organizations

10 © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Module 2: Introduction to Machine Learning

Section 2: Business problems solved with machine


learning

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Common business use cases

Recommended items

Spam versus Recommendations Fraud


regular email

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 12
Types of machine learning

Supervised Machine Reinforcement


learning learning learning

Unsupervised
learning

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 13
Supervised learning
Learn by identifying patterns in data that is already labeled.
Binary [0,1] • Fraud detection
• Image recognition
Classification
• Customer retention
Multi [0,1,2] • Medical diagnostics
Supervised • Personalized advertising
learning
• Product sales prediction
Regression • Weather forecasting
• Market forecasting
• Population growth prediction
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 14
Computer vision

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 15
Unsupervised learning

The machine must uncover and create the labels itself.

• Product recommendations
• Customer segmentation
Clustering
• Targeted marketing
• Medical diagnostics
Unsupervised
learning
• Visualization
Dimensionality • Natural language processing
reduction • Data structure discovery
• Gene sequencing
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 16
Natural language processing

gögn eru lykilatriði los datos son clave


Hi!

I’d like two


chickens,
please. Once upon a
time

Right, two
chickens, let me
get that started for
you.

Poor story. Little character development. Jumps between scenes like you
might get caught stealing. Unexplained bad guys appear with the thinnest of
back story. Back to unlimited resources and lets not talk about the
mechanics of building something so huge in such an inhospitable place...

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 17
Reinforcement learning

Learning through trial and error.

• Game AI
Reinforcement • Self-driving cars
learning
• Robotics +1+
1
• Customer service routing
AWS DeepRacer
Best when the desired outcome is known but the
exact path to achieving it is not known.
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 18
Self-driving vehicles

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 19
When to use machine learning?

Classical programming approach


Use machine learning when you have:
 Large datasets, large number of variables
Business logic  Lack of clear procedures to obtain the solution
Task
Procedures  Existing machine learning expertise
 Infrastructure already in place to support ML
 Management support for ML
Machine learning approach

Data Model Task

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 20
• Machine learning applications affect
Section 2 key everyday life
takeaways • Machine learning can be grouped
into –
• Supervised learning
• Unsupervised learning
• Reinforcement learning
• Most problems are supervised
learning

21 © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Module 2: Introduction to Machine Learning

Section 3: Machine learning process

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ML pipeline: Business problem

Business problem

Problem
formulation

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 23
ML pipeline: Data preparation
Data handling and cleaning
Business problem
data

Problem data data


formulation
data

Collect and
Evaluate data
Name Country Sex dob
label data
Richard Roe UK Male 18/2/1972
Paulo Santos Male 11/2/1969
Mrs. Mary Major Denver F 37
Desai, Arnav USA M 2/22/1962

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 24
ML pipeline: Iterative model training

Business problem

Problem
Tune model
formulation

Meets
Collect and Feature Select and train
Evaluate data Evaluate model business
label data engineering model
goal?

No
Feature augmentation

Data augmentation

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 25
ML pipeline: Feature engineering
Name Country Sex dob
Richard Roe UK Male 18/2/1972
Paulo Santos Male 11/2/1969

?
Mrs. Mary Major Denver F 37
Desai, Arnav USA M 2/22/1962

Name USA UK sex age bm dow target


Richard Roe 0 1 0 49 2 5 140,000
Paulo Santos 1 0 0 51 11 7 78,000
Mary Major 1 0 1 37 NAN 0 167,000
Arnav Desai 1 0 0 58 2 4 100,000

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 26
ML pipeline: Model training

Name USA UK sex age bm dow target


10–20%
Richard Roe 0 1 0 49 2 5 140,000 Test data
… … … … … … … …

80%

Algorithm
Trained model
XGBoost

{hyperparameters}

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 27
ML pipeline: Evaluating and tuning the
model
Name USA UK sex age bm dow target
10-20%
Richard Roe 0 1 0 49 2 5 140,000 Test data
… … … … … … … …

Change 80% predict


features
Algorithm
Trained model Hosted model
XGBoost

{hyperparameters}
Change hyperparameters

Metrics
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 28
Overfitting and underfitting

Y Y Y

X X X
Overfitting Underfitting Balanced

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 29
ML pipeline: Deployment
New data, retraining
Deploy model
Business problem

Problem Yes
Tune model
formulation

Meets
Collect and Feature Select and train
Evaluate data Evaluate model business
label data engineering model
goal?

No
Feature augmentation

Data augmentation

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 30
• Machine learning pipeline guides
Section 3 key you through the process of
takeaways evaluating and training a model
• Iterative process of –
• Data processing
• Training
• Evaluation

31 © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Module 2: Introduction to Machine Learning

Section 4: Machine learning tools overview

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Python tools and libraries

• Jupyter Notebook • pandas


• JupyterLab • Matplotlib
• Seaborn
• NumPy
• scikit-learn

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 33
Machine learning frameworks and
infrastructure
Machine learning frameworks provide Amazon instances that are designed for
tools and code libraries: machine learning applications:
• Customized scripting • AWS IoT Greengrass provides an
• Integration with AWS services infrastructure for building machine learning
for IoT devices
• Community of developers
• Amazon Elastic Inference reduces costs for
running machine learning applications

PyTorch Caffe2 Torch

TensorFlow Gluon Chainer EC2 P3 EC2 C5 AWS IoT Amazon


instances and C5n Greengrass Elastic
instances Inference
Keras CNTK Apache MXNet

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 34
Amazon SageMaker

Ground Truth Notebook Training Inference AWS Marketplace


Set up and manage Provide AWS and Train and tune Create models from Find, buy, and deploy
labeling jobs for SageMaker SDKs models at any scale. training jobs, or import ready-to-use model
highly accurate and sample Use high- external models for packages, algorithms,
training datasets by notebooks to create performance AWS hosting so you can run and data products in
using active learning training jobs and algorithms, or bring inferences on new data. AWS Marketplace.
and human labeling. deploy models. your own.

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 35
Demonstration:
Introducing
Amazon
SageMaker

36 © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Machine learning managed services

These managed services don’t require ML experience.


Computer Chatbots
vision

Amazon Rekognition Amazon Textract Amazon Lex

Speech Forecasting

Amazon Polly Amazon Transcribe Amazon Forecast

Language Recommendations

Amazon Comprehend Amazon Translate Amazon Personalize


© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 37
• Python is the most popular ML
Section 4 key language
takeaways • Jupyter Notebooks
• Many open-source tools
• Frameworks and services for all
requirements
• Low-level frameworks
• Amazon SageMaker
• Managed ML services

38 © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Module 2: Introduction to Machine Learning

Section 5: Machine learning challenges

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Machine learning challenges

• Poor quality
• Lack of data science expertise
• Non-representative
• Cost of staffing with data scientists
• Insufficient
Data Users • Lack of management support
• Overfitting and underfitting

• Complexity in formulating questions • Data privacy issues


• Explaining models to the business • Tool selection can be complicated
• Cost of building systems • Integration with other systems
Business Technology

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 40
Using existing models and services

• Amazon ML managed services


• No ML experience needed
Amazon ML
managed services

You Only Look • Use existing trained and tuned models


Once • Enhance with domain-specific instances
(YOLO)

• Over 250 ML model packages and algorithms


• Over 14 industry segments
AWS Marketplace
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 41
• Machine learning challenges
Section 5 key • Data
takeaways • People
• Business
• Technology
• Managed services simplify machine
learning

42 © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Module 2: Introduction to Machine Learning

Module wrap-up

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Machine learning is a subset of artificial intelligence
• Machine learning applies learning algorithms to
Module takeaways develop models from large datasets
• The machine learning pipeline describes the
different stages for developing a machine learning
application
• The Amazon Machine Learning stack has three key
layers
• Managed services, machine learning services,
machine learning frameworks
• Machine learning development is different from
traditional development
• Training algorithm is applied to data to create a
model for making predictions

44 © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Module summary

In summary, in this module, you learned how to:


• Recognize how machine learning and deep learning are part of artificial intelligence
• Describe artificial intelligence and machine learning terminology
• Identify how machine learning can be used to solve a business problem
• Describe the machine learning process
• List the tools available to data scientists
• Identify when to use machine learning instead of traditional software development
methods

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 45
Complete the knowledge check

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 46
Additional resources

• What is Machine Learning?


• Machine Learning on AWS

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 47
Thank you

© 2021 Amazon Web Services, Inc. or its affiliates. All rights reserved. This work may not be reproduced or redistributed, in whole or in part, without prior written permission from Amazon
Web Services, Inc. Commercial copying, lending, or selling is prohibited. Corrections, feedback, or other questions? Contact us at https://support.aws.amazon.com/#/contacts/aws-training.
All trademarks are the property of their owners.

You might also like