Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Build Your Own ML Application

with Amazon SageMaker, AWS Glue and


Amazon API Gateway

Giuseppe Angelo Porcelli


Principal, ML Specialist Solutions Architect
Amazon Web Services EMEA

© 2019, Amazon Web Services, Inc. or its Affiliates.


THE MACHINE LEARNING PROCESS
Business Problem -

Re-training
ML problem
Data Collection
framing

Feature Monitoring &


Data Integration Engineering Debugging

Data Augmentation
Data Preparation & Model Training & - Predictions
Cleaning Parameter Tuning

Data Visualization
Model Evaluation Model Deployment
& Analysis

Augmentation
Feature

No Are Yes
Business
goals met?

© 2019, Amazon Web Services, Inc. or its Affiliates.


GOALS FOR TODAY

• Execute the Machine Learning process on AWS, from data preparation


to model training and deployment

• Build a REST API that will invoke the deployed model and will act as
the front door for client applications

• Use a client-side single-page application to invoke the REST API and


get inferences

© 2019, Amazon Web Services, Inc. or its Affiliates.


THE MACHINE LEARNING TASK
• Synthetic wind turbine plant dataset
• Each example reports whether the plant is going to breakdown
• Several continuous and categorical variables

1. Preprocess the data to make it suitable for Machine Learning


2. Build a basic binary classification model to predict if the plant is going to
breakdown
© 2019, Amazon Web Services, Inc. or its Affiliates.
ARCHITECTURE
IDEs

Jupyter Cloud9 IDE and CloudFormation deployment

Amazon SageMaker AWS Cloud9 AWS CloudFormation


Notebook Instance
Client-side
Angular application

Amazon Athena AWS Glue Amazon SageMaker Amazon SageMaker Amazon API Gateway
Training Hosting

Data, code,
dependencies and
models AWS Lambda

Amazon Elastic Container


Registry
© 2019, Amazon Web Services, Inc. or its Affiliates.
Architecture Details

© 2019, Amazon Web Services, Inc. or its Affiliates.


AMAZON SAGEMAKER NOTEBOOK INSTANCE
VPC

Amazon SageMaker
• Fully-managed Jupyter Notebook with
flexible choice of ML compute instances
HTTPS Endpoint
• Anaconda packages and libraries for
common Deep Learning platforms
Client Browser • Jupyter/JupyterLab interfaces
ML Compute CPU
• Over 200 example notebooks
Instance
GPU
• Git integration
• Lifecycle Configurations
ML Storage • Access to Terminal through Jupyter
• Root/non-root access
• VPC & encryption

© 2019, Amazon Web Services, Inc. or its Affiliates.


AWS GLUE

§ Hive Metastore compatible with enhanced functionality


§ Crawlers automatically extract metadata and create tables

Data Catalog § Integrated with Amazon Athena, Amazon Redshift Spectrum

§ Auto-generates ETL code


§ Build on open frameworks – Python and Spark (and SparkML)
Job Authoring § Developer-centric – editing, debugging, sharing

§ Run jobs on a serverless Spark platform


§ Provides flexible scheduling
Job Execution § Handles dependency resolution, monitoring, and alerting

© 2019, Amazon Web Services, Inc. or its Affiliates.


AMAZON SAGEMAKER TRAINING
Elastic Container Registry

VPC BUILT-IN ALGORITHMS

BRING YOUR OWN SCRIPT


Amazon SageMaker Training
BRING YOUR OWN CONTAINER
ML Compute ML Compute ML Compute
Instance Instance Instance AWS MARKETPLACE


Training Config
InputDataConfig Training Code Training Code Training Code
Instance Type
Intance Count
Container URI
Hyperparameters Amazon Simple Storage
etc. Service (S3) Bucket
Model Artifacts
ML Storage ML Storage ML Storage

Datasource: S3, EFS or FSx for Lustre

© 2019, Amazon Web Services, Inc. or its Affiliates.


AMAZON SAGEMAKER HOSTING
Input Data (request)

VPC Client Application

Amazon SageMaker Hosting

Inference (response)
HTTPS Endpoint

Endpoint Configuration

Production Variant Production Variant

ML Compute Instance ML Compute Instance ML Compute Instance

Pipeline Model Pipeline Model Pipeline Model


AWS Auto Scaling
… … …
Model 1 Model n Model 1 Model n Model 1 V2 Model n V2

© 2019, Amazon Web Services, Inc. or its Affiliates.


AMAZON API GATEWAY

AWS Your VPC

AWS Lambda
API functions Endpoints
Gateway in your VPC
Mobile apps cache

AWS
Endpoints on Lambda
Amazon EC2 functions
Websites

Internet Amazon
CloudFront
All publicly
accessible
endpoints
Services
Regional API Endpoints

Amazon CloudWatch Any other


monitoring AWS service

© 2019, Amazon Web Services, Inc. or its Affiliates.


GET STARTED!

© 2019, Amazon Web Services, Inc. or its Affiliates.


Please browse to:

https://tinyurl.com/endtoendmlapp

© 2019, Amazon Web Services, Inc. or its Affiliates.


Thank You
Giuseppe Angelo Porcelli
Principal, ML Specialist Solutions Architect
Amazon Web Services EMEA

© 2019, Amazon Web Services, Inc. or its Affiliates.

You might also like