Top Banner
機械学習システムのデプロイパターン Aki Ariga | Field Data Scientist
36

How to go into production your machine learning models? #CWT2017

Jan 21, 2018

Download

Engineering

Cloudera Japan
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: How to go into production your machine learning models? #CWT2017

1© Cloudera, Inc. All rights reserved.

機械学習システムのデプロイパターン

Aki Ariga | Field Data Scientist

Page 2: How to go into production your machine learning models? #CWT2017

2© Cloudera, Inc. All rights reserved.

• (Twitter/Github @chezou)

• Field Data Scientist @ Cloudera

• NLP/ /

• Rails

Page 3: How to go into production your machine learning models? #CWT2017

3© Cloudera, Inc. All rights reserved.

Page 4: How to go into production your machine learning models? #CWT2017

4© Cloudera, Inc. All rights reserved. 4

Artificial Intelligence( )

Machine Learning

by Splintax CC BY-SA 3.0https://commons.wikimedia.org/wiki/File:IF-THEN-ELSE-END_flowchart.png

Deep Learning

Good to read: https://blogs.nvidia.com/blog/2016/07/29/whats-difference-artificial-intelligence-machine-learning-deep-learning-ai/

Page 5: How to go into production your machine learning models? #CWT2017

5© Cloudera, Inc. All rights reserved.

○ e.g.) , ●

○ e.g.) ●

○ e.g.) ●

○ e.g.) ●

○ e.g.) Amazon, Netflix●

e.g.) Alpha-Go, ● etc…

Page 6: How to go into production your machine learning models? #CWT2017

6© Cloudera, Inc. All rights reserved.

Non-Spam

Spam

Page 7: How to go into production your machine learning models? #CWT2017

7© Cloudera, Inc. All rights reserved.

[0, 1, 0, 2.5, 0, -1, ...][1, 0.5, 0.1, -2, 3, 2, ...][1, 0, 1.0, 1.1, 0, 0, ...]

Logistic Regression,SVM, Random Forest, NN...

w1=1, w2=-1, w3=0 ...

)

Page 8: How to go into production your machine learning models? #CWT2017

8© Cloudera, Inc. All rights reserved.

From data to exploration to action

Data Engineering Data Science (Exploratory) Production (Operational)

Data Models Business ValuePredictions

Page 9: How to go into production your machine learning models? #CWT2017

9© Cloudera, Inc. All rights reserved.

Page 10: How to go into production your machine learning models? #CWT2017

10© Cloudera, Inc. All rights reserved.

Reports Dashboards Scoring

Page 11: How to go into production your machine learning models? #CWT2017

11© Cloudera, Inc. All rights reserved.

Page 12: How to go into production your machine learning models? #CWT2017

12© Cloudera, Inc. All rights reserved.

1. REST API2. DB3.4.

Page 13: How to go into production your machine learning models? #CWT2017

13© Cloudera, Inc. All rights reserved.

Web

DB

/

API

RESTAPI

User ID/Item ID

Microservices architecture: Web ML REST (or gRPC) APIML

ML

Page 14: How to go into production your machine learning models? #CWT2017

14© Cloudera, Inc. All rights reserved.

DB

Web API

RESTAPI

User ID/Item ID

DB

/

ML

Page 15: How to go into production your machine learning models? #CWT2017

15© Cloudera, Inc. All rights reserved.

REST API

Web

DB

/

API

RESTAPI

User ID/Item ID

ML

Page 16: How to go into production your machine learning models? #CWT2017

16© Cloudera, Inc. All rights reserved.

Page 17: How to go into production your machine learning models? #CWT2017

17© Cloudera, Inc. All rights reserved.

& /

&

PMMLexport

Model building layerPredicting & serving layer

CDSW

HDFS

Page 18: How to go into production your machine learning models? #CWT2017

18© Cloudera, Inc. All rights reserved.

&/

&

Model building layerPredicting & serving layer

HDFS

Dockerimage

CDSW

Page 19: How to go into production your machine learning models? #CWT2017

19© Cloudera, Inc. All rights reserved.

Demo:

https://github.com/chezou/cdsw-serve-docker

Page 20: How to go into production your machine learning models? #CWT2017

20© Cloudera, Inc. All rights reserved.

CDSW

Amazon ECS

Application Load Balancer

AmazonS3

Docker HUBDockerimage

Source code

Trained model

Predictionrequest

Page 21: How to go into production your machine learning models? #CWT2017

21© Cloudera, Inc. All rights reserved.

Cloudera Data Science Workbench(CDSW)エンタープライズのためのセルフサービスデータサイエンス基盤

- GPU

-fork

- Docker

- Spark

-

Page 22: How to go into production your machine learning models? #CWT2017

22© Cloudera, Inc. All rights reserved.

● Pros○ Web ML

○ A/B ○

● Cons

○ API○

Page 23: How to go into production your machine learning models? #CWT2017

23© Cloudera, Inc. All rights reserved.

Web

DB

ML

/

DB : Web ML DB

Page 24: How to go into production your machine learning models? #CWT2017

24© Cloudera, Inc. All rights reserved.

DB /

Web

DB

ML

/

Page 25: How to go into production your machine learning models? #CWT2017

25© Cloudera, Inc. All rights reserved.

DB / DB

Web

/

DB

ML

Page 26: How to go into production your machine learning models? #CWT2017

26© Cloudera, Inc. All rights reserved.

DB

Web ML

/

DB

Page 27: How to go into production your machine learning models? #CWT2017

27© Cloudera, Inc. All rights reserved.

Kudu/HBase

/

&

Model building & predicting layerServing layer

HDFS

CDSW

Page 28: How to go into production your machine learning models? #CWT2017

28© Cloudera, Inc. All rights reserved.

● Pros○ Web ML

○ :○

● Cons

○ Web

Page 29: How to go into production your machine learning models? #CWT2017

29© Cloudera, Inc. All rights reserved.

Web ML

( : Spark Streaming)

&

--- Kafka MQ

(:K

afk

a)

Page 30: How to go into production your machine learning models? #CWT2017

30© Cloudera, Inc. All rights reserved.

Page 31: How to go into production your machine learning models? #CWT2017

31© Cloudera, Inc. All rights reserved.

● Pros○

● Cons

Page 32: How to go into production your machine learning models? #CWT2017

32© Cloudera, Inc. All rights reserved.

DB

ML

/

/

export/

DB

&

Page 33: How to go into production your machine learning models? #CWT2017

33© Cloudera, Inc. All rights reserved.

&/

&

/export

Model building layerPredicting & serving layer

HDFS

CDSW

Page 34: How to go into production your machine learning models? #CWT2017

34© Cloudera, Inc. All rights reserved.

Page 35: How to go into production your machine learning models? #CWT2017

35© Cloudera, Inc. All rights reserved.

○ CDSW Job

○ NA ( )

○ 1■ PMML export OpenScoring API■ API Docker■ API

○ 2■ CDSW HBase/Kudu/RDB

○ 3■

○ 4■ TensorFlow export/CoreML

Page 36: How to go into production your machine learning models? #CWT2017

36© Cloudera, Inc. All rights reserved.

Thank you

Aki Ariga @[email protected]