build a recommendation engine on aws...

37
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Yotam Yarden Data Scientist, Amazon Web Services Build a Recommendation Engine on AWS Today

Upload: others

Post on 17-Mar-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Yotam Yarden

Data Scientist, Amazon Web Services

Build a Recommendation Engine on AWS

Today

Page 2: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Agenda

• Recommendation Engine – Why?

• Recommendation Engine – Common Techniques

• Introducing Amazon SageMaker

• Develop, Train & Deploy a Recommendation Engine in 15

minutes

• Customer use cases

Page 3: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Artificial Intelligence At Amazon (1995)

Page 4: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

And today…

My Profile – amazon.de My Profile – amazon.com

Page 5: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

• Personalize and enhance customer

experience

• Different goals:

• Increased time spent on a platform

• Suggest complementary items

• Customer satisfaction

Motivation

Page 6: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Use Cases

Ecommerce:• Amazon.com

Content:• Movies (Netflix)

• Music (Amazon Music)

• Articles (The Global And Mail)

Finance:• Services Recommendation

• Stocks buying / selling

• Relevant news and stock related data

Education: • Courses recommendations

Legal:• Similar cases

Page 7: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Agenda

• Recommendation Engine – Why?

• Recommendation Engine – Common Techniques

• Introducing Amazon SageMaker

• Develop, Train & Deploy a Recommendation Engine in 15

minutes

• Customer Use Cases

Page 8: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

https://www.oreilly.com/ideas/deep-matrix-factorization-using-apache-mxnet?cmp=tw-data-na-article-engagement_sponsored+kibird

Page 9: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Supervised Machine Learning

All Labeled Data

Train Test

Model Training Model

Labels

Test Set

Predictions

|Predictions – True Labels|

= Accuracy

Page 10: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

https://www.oreilly.com/ideas/deep-matrix-factorization-using-apache-mxnet?cmp=tw-data-na-article-engagement_sponsored+kibird

Te

st se

t

Test / Validation

Page 11: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Naïve approach

Linear model? [type of user, movie genre, etc.]

Polynomial model? [+interactions]

Page 12: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Matrix Factorization

X≈

User

Em

beddin

gs

Item Embeddings

Page 13: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Matrix Factorization – “Neural Networks” Representation

Page 14: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Deep Matrix Factorization

Page 15: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 16: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Binary Predictions

Page 17: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Binary Predictions

+Negative Sampling

Negative

Page 18: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Most of the Data is Still Untapped

• Images

• Titles

• Descriptions

• Reviews

• Episode Names

Page 19: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

DSSM – Deep Structures Semantic Models

User

Embedding

Item

Embedding

⨀⨁ score

output

user Search

BOW

title words

BOW

resnet: imgs

dropout

dense densedensedensedense

concat concat

densedense

Page 20: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Which Technique to Choose? Roadmap Matrix

Iterative process

Data Available Limited user data

Binary user-item interaction

User data

Additional user-item interaction

More user data

Extensive item data

Extensive user

data

Extensive item data

Relevant Algorithms

Matrix FactorizationBinary

Matrix Factorization

Factorization MachinesDiFacto

DSSM Customized and

more advanced DSSM

Relative Complexity

2 4 5 5

Deployment Considerations

Historical data size – 30d / 60d / 1y…

Fine-tuning techniques (daily, weekly..)

Inference - compressed model? Tradeoff between model complexity and inference latency

Validation system setup

Iterate fast and simple

Page 21: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Agenda

• Recommendation Engine – Why?

• Recommendation Engine – Common Techniques

• Introducing Amazon SageMaker

• Develop, Train & Deploy a Recommendation Engine in 15

minutes

• Customer Use Cases

Page 22: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

ML @ AWS: Our mission

Put machine learning in the hands of every developer

and data scientist

Page 23: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Customer Running ML on AWS Today

Page 24: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

ML is still too complicated for everyday developers and data scientists

Collect and prepare

training data

Choose and

optimize your ML

algorithm

Set up and manage

environments for

training

Train and tune model

(trial and error)

Deploy model

in production

Scale and manage

the production

environment

Page 25: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

A m a z o n S a g e M a k e r

E a s i l y b u i l d , t r a i n , a n d d e p l o y

m a c h i n e l e a r n i n g m o d e l s

Page 26: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon SageMaker

Pre-built

notebooks for

common

problems

BUILD

Choose and

optimize your ML

algorithm

Set up and manage

environments for

training

Train and tune model

(trial and error)

Deploy model

in production

Scale and manage

the production

environment

Page 27: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Pre-built

notebooks for

common

problems

K-Means Clustering

Principal Component Analysis

Neural Topic Modelling

Factorization Machines

Linear Learner - Regression

XGBoost

Latent Dirichlet Allocation

Image Classification

Seq2Seq

Linear Learner - Classification

ALGORITHMS

Apache MXNet

TensorFlow

Caffe2, CNTK,

PyTorch, Torch

FRAMEWORKSSet up and m anage

env i r onment s f o r

t r a i n ing

Tr a i n and t une

m odel ( t r i a l and

er r o r )

Dep l oy m odel

i n p r oduct ion

Sca l e and m anage t he

p r oduc t ion env i r onment

Built-in, high

performance

algorithms

BUILD

Amazon SageMaker

Page 28: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Pre-built

notebooks for

common

problems

Built-in, high

performance

algorithms

One-click

training

BUILD TRAIN

Train and tune model

(trial and error)

Deploy model

in production

Scale and manage

the production

environment

Amazon SageMaker

Page 29: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Pre-built

notebooks for

common

problems

Built-in, high

performance

algorithms

One-click

training

Hyperparameter

optimization

BUILD TRAIN

Deploy model

in production

Scale and manage

the production

environment

Amazon SageMaker

Page 30: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Pre-built

notebooks for

common

problems

Built-in, high

performance

algorithms

One-click

deployment

One-click

training

Hyperparameter

optimizationScale and manage

the production

environment

BUILD TRAIN DEPLOY

Amazon SageMaker

Page 31: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Fully managed

hosting with auto-

scaling

One-click

deploymentPre-built

notebooks for

common

problems

Built-in, high

performance

algorithms

One-click

training

Hyperparameter

optimization

BUILD TRAIN DEPLOY

Amazon SageMaker

Page 32: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Agenda

• Recommendation Engine – Why?

• Recommendation Engine – Common Techniques

• Introducing Amazon SageMaker

• Develop, Train & Deploy a Recommendation Engine in

15 minutes

• Customer Use Cases

Page 33: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

console

Page 34: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Agenda

• Recommendation Engine – Why?

• Recommendation Engine – Common Techniques

• Introducing Amazon SageMaker

• Develop, Train & Deploy a Recommendation Engine in 15

minutes

• Customer Use Cases

Page 35: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Customers Use CasesErento’s in-house Data Science team is using Amazon SageMaker to build and deploy ML models tosolve item availability and decrease the enquiry-to-offer time through a recommendation system,which suggests similar items that are available and increases the chance for a successful booking.Using Amazon SageMaker reduced our recommendation system building time from half a yearto few weeks and reduced the algorithm training time from hours to few seconds. It also helped usreduce dependencies between projects, which has streamlined our whole pre-deployment process.- Wassim Zoghlami, Data Scientist Engineer at Erento

Using machine learning, we can provide better recommendations for our clients and enhance theircustomer experience. The AWS ML Acceleration Program delivered by the Professional Services Team,was really useful and suited our business needs. We believe that with Amazon SageMaker we canbuild a great recommendation system, and will be able to scale our ML training and deploymentjobs in a more simple and faster way.- Igor Veremchuk - Director of Engineering at Datajet

Once we at HolidayPirates decided to take a strategic step towards personalization, we wanted tomove fast. With the help of AWS Professional Services and the account team introducing us toAmazon SageMaker we are now able to develop, train and deploy recommendation systemmodels in a very short time and independently from any other department. We no longer need towear the hats of IT, big data, data science etc, and we can focus on what is important for ourcustomers and enhance their user experience.- Bojan Kostic, Data Team Lead at HolidayPirates

““

““

Page 36: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

References

• https://www.oreilly.com/ideas/deep-matrix-factorization-using-apache-mxnet

• https://github.com/apache/incubator-mxnet

• https://github.com/awslabs/amazon-sagemaker-examples

• https://www.csie.ntu.edu.tw/~b97053/paper/Rendle2010FM.pdf

• https://www.youtube.com/watch?v=cftJAuwKWkA

• https://www.youtube.com/watch?v=1cRGpDXTJC8&t=640s

Page 37: Build a Recommendation Engine on AWS Todayaws-de-media.s3.amazonaws.com/images/AWS_Summit_2018/June6/Doppler/Build Your...was really useful and suited our business needs. We believe