SlideShare une entreprise Scribd logo
1  sur  60
Télécharger pour lire hors ligne
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon SageMaker를 이용한
예측 분석
남궁 영환
AI/ML Specialist Solutions Architect
Amazon Web Services
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
강연 중 질문하는 방법
Go to Webinar “Questions” 창에 자신이 질문한
내역이 표시됩니다. 기본적으로 모든 질문은
공개로 답변 됩니다만 본인만 답변을 받고 싶으면
(비공개)라고 하고 질문해 주시면 됩니다.
본 컨텐츠는 고객의 편의를 위해 AWS 서비스 설명을 위해 온라인 세미나용으로 별도로 제작, 제공된 것입니다. 만약 AWS
사이트와 컨텐츠 상에서 차이나 불일치가 있을 경우, AWS 사이트(aws.amazon.com)가 우선합니다. 또한 AWS 사이트
상에서 한글 번역문과 영어 원문에 차이나 불일치가 있을 경우(번역의 지체로 인한 경우 등 포함), 영어 원문이 우선합니다.
AWS는 본 컨텐츠에 포함되거나 컨텐츠를 통하여 고객에게 제공된 일체의 정보, 콘텐츠, 자료, 제품(소프트웨어 포함) 또는 서비스를 이용함으로 인하여 발생하는 여하한
종류의 손해에 대하여 어떠한 책임도 지지 아니하며, 이는 직접 손해, 간접 손해, 부수적 손해, 징벌적 손해 및 결과적 손해를 포함하되 이에 한정되지 아니합니다.
고지 사항(Disclaimer)
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Agenda
• Amazon & AWS의 AI/ML
• Amazon SageMaker
 주요 특징
 Hyperparameter Tuning
 빌트인 알고리즘
• 시계열 예측 분석
• Demo
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
인공지능 & 머신러닝 유스케이스의 폭발적인 증가
이미지 인식 및 태깅 (예: 효율적인 사진 정리)
객체 탐지, 트래킹, 내비게이션 (예: 자율 주행 차량 기술)
음성 인식 및 합성 (예: 지능형 음성 비서 기술)
알고리즘 기반 트레이딩 전략 관련 성능 향상
감성 분석 (예: 개인화 및 맞춤형 광고 기술)
AI (Artificial Intelligence) ML (Machine Learning)
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon의 머신러닝(ML) 관련 주요 분야
물류 및
재고 관리
검색/추천
기존 상품
관리 효율화
신규 상품
맞춤형 제시
AWS
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ML @ AWS
OUR MISSION
전세계 모든 데이터
과학자와 개발자에게 편리한
머신 러닝 연구 개발 환경을
제공
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS 상에서 머신 러닝을 활용하고 있는 고객
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon ML stack
Frameworks
&
Infrastructure
Application
Services
Managed
Platform
Services
KERAS
A W S D E E P L E A R N I N G A M I
A M A Z O N S A G E M A K E R
R E K O G N I T I O N R E K O G N I T I O N V I D E O P O L L Y T R A N S C R I B E T R A N S L A T E C O M P R E H E N D L E X
S P E E C H L A N G U A G E
A W S D E E P L E N S A M A Z O N M A C H I N E
L E A R N I N G
S P A R K & E M R A M A Z O N
M E C H A N I C A L T U R K
G P U ( P 3 I N S T A N C E S ) C P U I O T ( G R E E N G R A S S ) M O B I L E
V I S I O N
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon SageMaker
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
머신 러닝 프로세스
Data Visualization
& Analysis
Business Problem –
Data Collection
Data Integration
Data Preparation
& Cleaning
Feature Engineering
Model Training &
Parameter Tuning
Model Evaluation
Are Business
Goals met?
Model Deployment
Monitoring &
Debugging
– Predictions
YesNo
DataAugmentation
Feature
Augmentation
Re-training
ML problem framing
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon SageMaker
손쉽게 머신 러닝 모델을 빌드, 트레이닝, 배포할 수 있는 완전 관리형 서비스
머신러닝 모델을 위한
트레이닝 데이터
수집 및 준비
머신 러닝 알고리즘
선정 및 최적화
머신 러닝 모델
트레이닝을 위한
환경 세팅 및 관리
머신 러닝 모델의
트레이닝 & 튜닝
(반복 개선 과정)
머신 러닝 모델의
프로덕션 환경 배포
프로덕션 환경에서
운영, 확장 및 관리
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Bring Your Own
Algorithms
ML Algorithms
R
MXNet
TensorFlow
Caffe/Caffe2
PyTorch
Keras
CNTK
…
Amazon SageMaker를 이용한 ML 모델 트레이닝
SageMaker Built-
in Algorithms
k-Means Clustering
PCA
Neural Topic Modelling
Factorization Machines
Linear Learner
XGBoost
Latent Dirichlet Allocation
Image Classification
Seq2Seq
DeepAR Forecasting
BlazingText (word2vec)
Random Cut Forest
k-Nearest Neighbour
Object Detection
SageMaker
Framework SDKs
TensorFlow SDK
MXNet (Gluon) SDK
Chainer SDK
PyTorch SDK
Apache Spark
Estimator
Apache Spark Python library
Apache Spark Scala library
Amazon
EMR
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon SageMaker: 참조 아키텍처
SageMaker
Notebooks
Training
Algorithm
SageMaker
Training
SageMaker
Hosting AWS
Lambda
API
Gateway
데이터 준비
Training Data
Inference
requests
Amazon
S3
Amazon
S3
트레이닝 & 튜닝 호스팅 & 배포
Raw
Data
Prepared
Data
Algorithm
Container
Trained
Model
Trained
Model
Hyperparameter
Optimization
User
Interactions
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Photo credit: https://www.flickr.com/photos/ceasedesist/5821282085
(Licensed for commercial use)
Hyperparameter Tuning
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hyperparameter Tuning
Image Classification 알고리즘
최적의 하이퍼파라미터로 트레이닝한 결과
label – bathtub
probability - 0.998812198638916
최초의 하이퍼파라미터로 트레이닝한 결과
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hyperparameter Tuning
Learning Rate
Regularization
Option 1: 그리드 탐색 (Grid Search)
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hyperparameter Tuning
Option 1: 그리드 탐색 (Grid Search)
gamma : Kernel coefficient for ‘rbf’, ‘poly’, and ‘sigmoid’
C: Penalty parameter
* SVC: Support Vector Clustering
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hyperparameter Tuning
Option 2: 랜덤 탐색 (Random Search)
Learning Rate
Regularization
Bergstra, Bengio, “Random Search for Hyper-Parameter Optimization”
https://dl.acm.org/citation.cfm?id=2188395
"그리드 탐색(Grid search)을 이용하는
뉴럴 네트워크와 비교했을 때,
동일한 문제와 모델에 랜덤 탐색
(Random search)을 이용하면
전체적으로 모델의 성능도 더
향상되고 계산 시간도 더 빨라짐 "
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hyperparameter Tuning
Option 2: 랜덤 탐색 (Random Search)
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hyperparameter Tuning
Option 3: Bayesian Optimization 기법
• A Tutorial on Bayesian Optimization of Expensive Cost Functions, with Application to
Active User Modeling and Hierarchical Reinforcement Learning
(https://arxiv.org/abs/1012.2599)
• Practical Bayesian Optimization of Machine Learning Algorithms
(https://arxiv.org/abs/1206.2944)
• Taking the Human Out of the Loop: A Review of Bayesian Optimization
(https://ieeexplore.ieee.org/document/7352306)
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hyperparameter Tuning in Amazon SageMaker
Amazon SageMaker의 Hyperparameter Tuning 기능은
Bayesian Optimization을 포함한 몇 가지 다양한
최적화 기법을 바탕으로 구현되어 있습니다.
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hyperparameter Tuning in Amazon SageMaker
Hyperparameter tuning finds the best hyperparameter using Bayesian optimization
모든 ML 알고리즘을 지원합니다:
• SageMaker의 빌트인 알고리즘
• 사용자 정의 알고리즘
• ML 프레임워크를 위해 Amazon SageMaker 상에서 사전에 빌드한 컨테이너
(TensorFlow, MXNet, Chainer) = bring-your-own-container
트레이닝 데이터셋
ML 알고리즘
Objective
선별된
Hyperparameters
가장 좋은 결과를 얻기
위한
Hyperparameter들을
추정
채택된
hyperparameters를
이용한 모델 트레이닝
가장 좋은
모델을
결과로 리턴
Configuration Bayesian Optimization Training Jobs
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hyperparameter Tuning in Amazon SageMaker
Configuration
Training Jobs
The result of models
Estimator
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hyperparameter Tuning in Amazon SageMaker
Automatic Model Tuning
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hyperparameter Tuning in Amazon SageMaker
Automatic Model Tuning
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hyperparameter Tuning in Amazon SageMaker
Automatic Model Tuning
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hyperparameter Tuning in Amazon SageMaker
Automatic Model Tuning
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SageMaker의 빌트인 알고리즘들
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
대규모 데이터 및 성능 향상에 최적화된 알고리즘
Amazon SageMaker 는 대용량 데이터 처리/분석 및 최적화된 성능을 지원하는 빌트인
알고리즘을 제공하며 지속적 추가 및 업데이트를 제공합니다.
Amazon provided algorithm Sample Use Cases
K-Means clustering 고객 군 분할; 분류
K-Nearest Neighbors 분류 또는 회귀에 사용되는 비모수 방식의 알고리즘
Principal Component Analysis 특징 차원 감소
Factorization Machines 추천 시스템
Linear regression 가격 예측
Binary classification 탈퇴 고객 예측
Latent Dirichlet Allocation 토픽에 따른 문서 분류
Neural Variational Document Model (NVDM) 자연어 처리를 이용한 문서 분류
XGboost Decision trees; 비정형 파악
Image Classifier (ResNet) 이미지를 구분하는 알고리즘
Object Detection Algorithm (SSD) 하나의 이미지로부터 다양한 물체를 찾아내고 인식하는 알고리즘
Sequence2Sequence 언어 번역
DeepAR RNN을 이용한 시계열 데이터 예측
BlazingText Word2Vec 구현; 자연어 처리를 위해 단어를 벡터로 변환
Random Cut Forest 비정상적인 데이터 추출
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Linear Learner
• Classification, Regression 문제에 활용
• 다양한 Objective metric 이용 가능
• Continuous: mean square error, cross entropy loss, absolute error
• Discrete: f1, precision-recall, accuracy
• SGD, Adam, Adagrad, rmsprop 등의 최적화 알고리즘 지원
• Preprocessing 지원
• unbias_data: 평균값을 0으로
• normalize_data: standard deviation을 1로
• 입력 데이터는 섞여(shuffled) 있어야 함.
(레이블 순서대로 정렬된 데이터를 사용할 경우, 정상적인 모델 트레이닝이 안 됨)
• Multi-class Classification 지원
• Auto ML Tuning 관련
• Linear Learner는 Auto ML Tuning 기능과는 별도로 hyperparameter 튜닝을 위한 내부
메카니즘을 보유하고 있음
(기본적으로, 여러 모델을 병렬로 트레이닝해서 Hyperparameter를 튜닝함)
• Auto ML Tuning 기능을 사용할 경우, 기본 Hyperparameter 튜닝 기능은 자동 차단됨
𝑌𝑖 = 𝛽0 + 𝛽1 𝑋𝑖 + 𝜀𝑖
Dependent
Variable
Random
Error term
Population
Y intercept
Population
Slope coefficient
Independent
Variable
https://towardsdatascience.com/linear-regression-in-python-9a1f5f000606
https://seaborn.pydata.org/examples/multiple_regression.html
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Factorization Machines
• SVM (Support Vector Machines) 알고리즘의 장점에
Factorization 모델링을 결합한 예측 알고리즘
• 많은 feature들을 가진 sparse 데이터셋을 다룰 때
효과적임 (예. 클릭 예측과 상품 추천)
• Dense한 데이터를 다룰 때에만 GPU를 사용하세요.
• Float32 tensors로 구성된 recordIO-protobuf
포맷을 지원합니다.
• FYI, see “Implementing a Recommender System
with SageMaker, MXNet, and Gluon(GitHub)”
Sparse 데이터 셋 예제
Factorization Machine 모델
ො𝑦 = 𝑤0 + ෍
𝑖
𝑤𝑖 𝑥𝑖 + ෍
𝑖
෍
𝑗>𝑖
< 𝑣𝑖, 𝑣𝑗 > 𝑥𝑖 𝑥𝑗
Cost Function
𝐿 =
1
𝑁
෍
𝑛
𝑦𝑛 − ො𝑦𝑛
2
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Boosted Decision Trees
• XGBoost (eXtreme Gradient Boosting)은 오픈 소스 기반의
Gradient boosted trees 알고리즘
• 다양한 분야에서 폭넓게 활용 중 (매출 예측, 웹 문서 구분,
고객 행동 예측, 모션 예측, 광고 클릭률 예측, Malware
구분, 제품 분류, 위험 예측 등)
• 현재는 libSVM 과 CSV 포맷을 지원 (Protobuf 아님)
What is the best split?
Tree ensemble model
?
https://homes.cs.washington.edu/~tqchen/pdf/BoostedTree.pdf
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Boosted Decision Trees
Tunable Hyperparameters
각 Parameter들의 의미와 역할을 이해하고 문제에 잘 맞도록 적용하는 것이
중요합니다.
Metric Name Description Optimization Direction
validation:rmse Root mean square error. Minimize
validation:mae Mean absolute error. You must choose one of them as an
objective to optimize when tuning the
algorithm with hyperparameter
values.>Minimize
validation:logloss Negative log-likelihood. Minimize
validation:error Binary classification error
rate, calculated as
#(wrong cases)/#(all
cases).
Minimize
validation:merror Multiclass classification
error rate, calculated as
#(wrong cases)/#(all
cases).
Minimize
validation:mlogloss Negative log-likelihood for
multiclass classification.
Minimize
validation:auc Area under the curve. Maximize
validation:ndcg Normalized Discounted
Cumulative Gain.
Maximize
validation:map Mean average precision. Maximize
Metrics Computed by the XGBoost Algorithm
Parameter Name Parameter Type Recommended Ranges
num_round IntegerParameterRanges [1, 4000]
eta
ContinuousParameterRange
s
MinValue: 0.1, MaxValue: 0.5
gamma
ContinuousParameterRange
s
MinValue: 0, MaxValue: 5
max_depth IntegerParameterRanges [0, 10]
min_child_weight
ContinuousParameterRange
s
MinValue: 0, MaxValue: 120
max_delta_step IntegerParameterRanges [0, 10]
subsample
ContinuousParameterRange
s
MinValue: 0.5, MaxValue: 1
colsample_bytree
ContinuousParameterRange
s
MinValue: 0.5, MaxValue: 1
colsample_bylevel
ContinuousParameterRange
s
MinValue: 0.5, MaxValue: 1
lambda
ContinuousParameterRange
s
MinValue: 0, MaxValue: 1000
alpha
ContinuousParameterRange
s
MinValue: 0, MaxValue: 1000
(Choose one of these metrics as the objective) (alpha, min_child_weight, subsample, eta, and num_round, etc.)
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
KNN: K-Nearest Neighbors
• 비모수(non-parametric) 방식의 인덱스 기반 알고리즘
 분류(Classification): 샘플 데이터와 가장 가까운 k개의 데이터 포인트를 대상으로 가장 많이
나타난 클래스 레이블을 할당
 회귀(Regression): 샘플 데이터와 가장 가까운 k개의 데이터 포인트를 대상으로, 피처 값의
평균을 결과로 리턴
• k-NN 알고리즘은 3단계로 구성되어 있습니다.
 샘플링: 초기의 데이터 크기를 메모리에 맞게 줄임 (sample_size)
 차원 축소: 데이터의 차원을 줄여나가는 단계
- 목적: 사용되는 메모리 크기 & 추론에 소요되는 시간을 줄이기 위해
- Random projection (sign) 모드, fast Johnson-Lindenstrauss transform(fjlt) 모드를 지원
 인덱스 구축: 최종단계에서 구축된 인덱스가 데이터들간의 거리를 효과적으로 Lookup 할 수
있게 함. (인덱스 타입 (index_type) 으로 flat index, inverted index 와 inverted index with
product quantization 세가지 모드를 지원)
• 트레이닝을 위한 데이터는 recordIO-protobuf 와 CSV 포맷을 지원
• Batch transform 모드에서는 application/jsonlines 데이터 포맷을 지원
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Random Cut Forest
• 데이터셋내에서 비정상적인 데이터를 찾아내는
Unsupervised learning 방식의 알고리즘
• 시계열 데이터내에서 spikes, 데이터의 주기성을 깨는 데이터,
분류를 할 수 없는 데이터 값들을 검출
• 각 데이터에 대해서 anomaly 스코어를 계산
(스코어가 높을수록 비정상일 확률이 높음을 의미)
• Amazon SageMaker의 RCF는 다차원 데이터를 지원하며
feature 개수, big data, 그리고 instance의 scalability가 뛰어남
• CPU에 최적화 되어 있음
Robust Random Cust Forest Based Anomaly Detection on Streams
http://proceedings.mlr.press/v48/guha16.pdf
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DeepAR
• scalar 타입의 시계열(Time-series) 데이터를 RNN
(Recurrent Neural Network)을 기반으로 예측하는 알고리즘
• train과 test의 2 채널을 지원합니다. prediction_length는
고정값입니다.
• 학습을 위한 데이터는 .json 과 .parquet 포맷을 지원합니다.
• CPU와 GPU 모두 지원합니다.
• Category값을 지원하여 (“cat”) 시계열 그룹의 특징들을
학습할 수 있습니다.
zi ,t − 2, xi ,t − 1 zi ,t − 1, xi ,t zi ,t , xi ,t + 1
hi ,t − 1 hi ,t hi ,t + 1
`(zi ,t − 1|✓i ,t − 1) `(zi ,t |✓i ,t ) `(zi ,t + 1|✓i ,t + 1)
zi ,t − 1 zi ,t zi ,t + 1
Input
Network
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Time-series Forecasting
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Time-series Forecasting - overview
Multi-step 𝒴𝑡+𝑘𝒴:𝑡
Covariates 𝒴𝑡+𝑘𝒴:𝑡, 𝑥:𝑡
(ℎ)
, 𝑥:𝑡
(𝑓)
, 𝑥(𝑠)
Multi time series 𝒴:𝑡
𝑖𝒴:𝑡
One-step-ahead 𝒴𝑡+1𝒴:𝑡 = (𝒴𝑡, ⋯ , 𝒴0)
Probabilistic Forecasting 𝑝 𝒴𝑡+𝑘|𝒴:𝑡𝔼(𝒴𝑡+𝑘|𝒴:𝑡)
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Multi-step forecasting variants
Direct
…
Recursive
• AR(autoregressive) 방법과 유사
• 시스템에서 다음 단계의 추정 결과를 ‘Ground Truth’로 간주해서 반복적으로 계산
• 트레이닝/예측의 차이를 보정하기 위한 정교한 트레이닝 기법이 필요 *
* Bengio et al., Scheduled Sampling for Sequence Prediction with Recurrent Neural Networks (2015)
**Taieb and Atiya, A Bias and Variance Analysis for Multi-Step-Ahead Time Series Forecasting (2016)
• 과거 이력을 바탕으로 를 바로 예측
• 과거 이력과 예측하려는 값 사이의 time step들은 무시
• More stable, less biased, more robust**
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Multi-step forecasting variants
• Temporal covariates
available in history
• 예: demand, usage,
weather, etc.
• Temporal covariates
available in history &
future
• 예: Holidays, supply,
prices, promotions,
weather, etc.
• ‘What-if’ 시나리오를 참고
• Static covariates
• 예: location, country, store
ID, etc.
y
x
History Future
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Probabilistic Forecasting
Point forecast
Parametric
• 가정: 데이터가 특정 확률 분포를 따름을 전제로 함
• 아래의 likelihood loss function을 통해 바로 답을 계산할 수 있는 파라미터셋을 예측
Non-parametric
• 예를 들어, 다음의 확률을 예측하는 Quantile 회귀 함수를 만들고 싶다면?
• 아래와 같은 전체 Quantile 손실 함수값이 최소가 되도록 구현해야 함
Probabilistic forecast
𝑝 𝒴𝑡+𝑘|𝒴:𝑡𝔼(𝒴𝑡+𝑘|𝒴:𝑡)
ℒ = ෍
𝑖=1
𝑁
෍
𝑡=𝑡0
𝑇
log⁡ ℓ(𝑧𝑖,𝑡|𝜃(𝐡𝑖,𝑡))
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Learning from multiple related timeseries
Neural Network 기법이 시계열 예측 분야에서 뛰어난 성능을 나타냄:
• very long history
• many covariates
• complex and non-linear relationships (spatial and temporal)
• multiple related timeseries
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data Generators for time series training
… 1 4 3 2 -1 0 3 2 6 4 4 …
… 3 2 5 4 6 -2 5 0 -4 2 4 …
Lookback = 4
Step = 2 Delay = 4
2 0 2 4
4 -2 0
Generator
y
x1
y
x1
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
From Dense to Recurrent Nets
2 0 2
4 -2 0
y
x1
y x1
2 0 2 4 -2 0
Flatten
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
From Dense to Recurrent Nets
y x1
2 0 2 4 -2 0
4
• Flattening the timeseries
loses temporal correlation
• The dense net requires a
lot of date to rediscover
these relationships (it can)
• Is there a way to preserve
temporal information?
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
From Dense to Recurrent Nets
2 0 2
4 -2 0
𝑥<𝑡>
𝑥<𝑡+1>
𝑥<𝑡−1>
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The simple recurrent memory cell
𝑥<𝑡>
𝑥<𝑡+1>
𝑥<𝑡−1>
𝑦<𝑡−1>
𝑦<𝑡>
𝑦<𝑡+1>
𝑎<𝑡−1>
𝑎<𝑡>
2 0 2
4 -2 0
4
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The simple recurrent memory cell
4
𝑎<𝑡>
= 𝑔(𝑊𝑎𝑥 𝑥<𝑡>
+ 𝑊𝑎𝑎 𝑎<𝑡−1>
+ 𝑏 𝑎)
𝑦<𝑡>
= 𝑔(𝑊𝑦𝑎 𝑎<𝑡>
+ 𝑏 𝑦)
Vanishing Gradients!
𝑥<𝑡>
𝑥<𝑡+1>
𝑥<𝑡−1>
𝑦<𝑡−1>
𝑦<𝑡>
𝑦<𝑡+1>
𝑎<𝑡−1>
𝑎<𝑡>
2 0 2
4 -2 0
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
LSTM: Long Short-Term memory
* Hochreiter, Sepp, and Jürgen Schmidhuber. “Long Short-Term Memory.” Neural Computation 9, no. 8 (November 1, 1997): 1735–80.
https://doi.org/10.1162/neco.1997.9.8.1735.
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
LSTM cell
xt
Ht-1
Ct-1
Previous
Cell State
Previous
Hidden State
Output Current Input
Ct
Ht
Ht
Current
Cell State
Current
Hidden State
Output
Current
Hidden State
Output
X +
ot
ft
X
it gt
X
Tanh
Ct
Input Gate Tanh Output GateForget Gate
𝜎 𝜎𝜎
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
LSTM Network
LSTM
Cell
LSTM
Cell
LSTM
Cell
LSTM
Cell
LSTM
Cell
Xt-2 xt Xt+2Xt-1 Xt+1
Temporal
Sequence Input
Ht-2
LSTM Layer
Hidden State
Output Ht Ht+2Ht-1 Ht+1
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Gated Recurrent Unit (GRU) Cell
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Summary of RNN types
One to many
𝑎<0>
𝑥
ො𝑦<1>
ො𝑦<2>
ො𝑦<𝑇𝑦>
⋯
𝑥<2>
𝑥<𝑇𝑥>
𝑎<0>
𝑥<1>
ො𝑦
⋯
Many to one
𝑎<0>
𝑥<1>
ො𝑦<𝑇𝑦>
⋯
𝑥<2>
𝑥<𝑇𝑥>
ො𝑦<1>
ො𝑦<2>
Many to many (Seq2Seq) Many to many
(delayed Seq2Seq)
⋯ ⋯𝑎<0>
𝑥<1>
ො𝑦<1>
⋯
𝑥<𝑇𝑥>
ො𝑦<𝑇𝑦>
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DeepAR*
* Flunkert, Valentin, David Salinas, and Jan Gasthaus. “DeepAR: Probabilistic Forecasting with Autoregressive Recurrent Networks.”
ArXiv:1704.04110 [Cs, Stat], April 13, 2017. http://arxiv.org/abs/1704.04110.
• Amazon SageMaker 에서 시계열 예측 분석을 위한 RNN 아키텍처
(완전 관리형, 뛰어난 확장성, 높은 정확도)
• 특정 시점 예측 및 확률 기반 예측 (다양한 노이즈 모델들 중 선택 가능) 지원
• 트레이닝 데이터 내의 여러 가지 관련 시계열을 기반으로 한 학습
(cold start problem)
• Recursive Multi-Horizon 및 static categorical variables 지원
• Amazon에서 매우 중요한 의사결정 문제들을 해결하는 과정 중 만들어진
알고리즘
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DeepAR*
* Flunkert, Valentin, David Salinas, and Jan Gasthaus. “DeepAR: Probabilistic Forecasting with Autoregressive Recurrent Networks.”
ArXiv:1704.04110 [Cs, Stat], April 13, 2017. http://arxiv.org/abs/1704.04110.
Training Prediction
ancestral
sampling
Encoder DecoderSeq2Seq
t0
likelihood
sampling
likelihoo
d
𝐡𝑖,𝑡0−1
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Likelihood model of DeepAR
Neural network predicts all parameters (e.g. mean and variance) of
likelihood function
For the experiments, two choices:
• Gaussian likelihood: real-valued data
• Negative binomial likelihood: positive count data
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Example Demand Forecasts
• Figure 1: cold start scenario. Since the model shares information across
items, predictions are reasonable even with limited historic data.
• Figure 2 & 3: probabilistic forecasts for products with different
magnitudes by using an appropriate likelihood function (Negative Binomial).
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Demo: Amazon SageMaker
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
참고 링크
• Getting started with Amazon SageMaker를 통한 실습:
• https://aws.amazon.com/sagemaker/
• Amazon SageMaker SDK 사용법 익히기:
• For Python: https://github.com/aws/sagemaker-python-sdk
• For Spark: https://github.com/aws/sagemaker-spark
• SageMaker Code Samples / Workshops:
• https://github.com/awslabs/amazon-sagemaker-examples
• https://github.com/awslabs/amazon-sagemaker-workshop
© 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
더 나은 세미나를 위해 여러분의 의견을 남겨주세요!
웨비나 종료 후 설문이 시작됩니다.
 질문에 대한 답변 드립니다.
 발표자료 / 녹화 영상을 제공합니다.
http://bit.ly/awskr-webinar
AWS 데이터 기반 의사결정 웹세미나에
참석해주셔서 대단히 감사합니다.

Contenu connexe

Tendances

Tendances (20)

AWS Summit Seoul 2023 | 삼성전자/쿠팡의 대규모 트래픽 처리를 위한 클라우드 네이티브 데이터베이스 활용
AWS Summit Seoul 2023 | 삼성전자/쿠팡의 대규모 트래픽 처리를 위한 클라우드 네이티브 데이터베이스 활용AWS Summit Seoul 2023 | 삼성전자/쿠팡의 대규모 트래픽 처리를 위한 클라우드 네이티브 데이터베이스 활용
AWS Summit Seoul 2023 | 삼성전자/쿠팡의 대규모 트래픽 처리를 위한 클라우드 네이티브 데이터베이스 활용
 
AWS Summit Seoul 2023 | Amazon Neptune 및 Elastic을 이용한 추천 서비스 및 검색 플랫폼 구축하기
AWS Summit Seoul 2023 | Amazon Neptune 및 Elastic을 이용한 추천 서비스 및 검색 플랫폼 구축하기AWS Summit Seoul 2023 | Amazon Neptune 및 Elastic을 이용한 추천 서비스 및 검색 플랫폼 구축하기
AWS Summit Seoul 2023 | Amazon Neptune 및 Elastic을 이용한 추천 서비스 및 검색 플랫폼 구축하기
 
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
 
AWS Summit Seoul 2023 | Amazon Redshift Serverless를 활용한 LG 이노텍의 데이터 분석 플랫폼 혁신 과정
AWS Summit Seoul 2023 | Amazon Redshift Serverless를 활용한 LG 이노텍의 데이터 분석 플랫폼 혁신 과정AWS Summit Seoul 2023 | Amazon Redshift Serverless를 활용한 LG 이노텍의 데이터 분석 플랫폼 혁신 과정
AWS Summit Seoul 2023 | Amazon Redshift Serverless를 활용한 LG 이노텍의 데이터 분석 플랫폼 혁신 과정
 
AWS Summit Seoul 2023 | 플로 AWS All-in 전략을 통해 음원서비스의 혁신을 이루다
AWS Summit Seoul 2023 | 플로 AWS All-in 전략을 통해 음원서비스의 혁신을 이루다AWS Summit Seoul 2023 | 플로 AWS All-in 전략을 통해 음원서비스의 혁신을 이루다
AWS Summit Seoul 2023 | 플로 AWS All-in 전략을 통해 음원서비스의 혁신을 이루다
 
Amazon SageMaker 모델 빌딩 파이프라인 소개::이유동, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스...
Amazon SageMaker 모델 빌딩 파이프라인 소개::이유동, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스...Amazon SageMaker 모델 빌딩 파이프라인 소개::이유동, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스...
Amazon SageMaker 모델 빌딩 파이프라인 소개::이유동, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스...
 
AWS 클라우드 이해하기-사례 중심 (정민정) - AWS 웨비나 시리즈
AWS 클라우드 이해하기-사례 중심 (정민정) - AWS 웨비나 시리즈AWS 클라우드 이해하기-사례 중심 (정민정) - AWS 웨비나 시리즈
AWS 클라우드 이해하기-사례 중심 (정민정) - AWS 웨비나 시리즈
 
LG전자 - Amazon Aurora 및 RDS 블루/그린 배포를 이용한 데이터베이스 업그레이드 안정성 확보 - 발표자: 이은경 책임, L...
LG전자 - Amazon Aurora 및 RDS 블루/그린 배포를 이용한 데이터베이스 업그레이드 안정성 확보 - 발표자: 이은경 책임, L...LG전자 - Amazon Aurora 및 RDS 블루/그린 배포를 이용한 데이터베이스 업그레이드 안정성 확보 - 발표자: 이은경 책임, L...
LG전자 - Amazon Aurora 및 RDS 블루/그린 배포를 이용한 데이터베이스 업그레이드 안정성 확보 - 발표자: 이은경 책임, L...
 
AWS Summit Seoul 2023 | 천만 사용자 서비스를 위한 Amazon SageMaker 활용 방법 진화하기
AWS Summit Seoul 2023 | 천만 사용자 서비스를 위한 Amazon SageMaker 활용 방법 진화하기AWS Summit Seoul 2023 | 천만 사용자 서비스를 위한 Amazon SageMaker 활용 방법 진화하기
AWS Summit Seoul 2023 | 천만 사용자 서비스를 위한 Amazon SageMaker 활용 방법 진화하기
 
KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...
KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...
KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...
 
AWS Summit Seoul 2023 | 천만 사용자를 위한 카카오의 AWS Native 글로벌 채팅 서비스
AWS Summit Seoul 2023 | 천만 사용자를 위한 카카오의 AWS Native 글로벌 채팅 서비스AWS Summit Seoul 2023 | 천만 사용자를 위한 카카오의 AWS Native 글로벌 채팅 서비스
AWS Summit Seoul 2023 | 천만 사용자를 위한 카카오의 AWS Native 글로벌 채팅 서비스
 
AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)
AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)
AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)
 
AWS Summit Seoul 2023 | 다중 계정 및 하이브리드 환경에서 안전한 IAM 체계 만들기
AWS Summit Seoul 2023 | 다중 계정 및 하이브리드 환경에서 안전한 IAM 체계 만들기AWS Summit Seoul 2023 | 다중 계정 및 하이브리드 환경에서 안전한 IAM 체계 만들기
AWS Summit Seoul 2023 | 다중 계정 및 하이브리드 환경에서 안전한 IAM 체계 만들기
 
세션 3: IT 담당자를 위한 Cloud 로의 전환
세션 3: IT 담당자를 위한 Cloud 로의 전환세션 3: IT 담당자를 위한 Cloud 로의 전환
세션 3: IT 담당자를 위한 Cloud 로의 전환
 
SK Telecom - 망관리 프로젝트 TANGO의 오픈소스 데이터베이스 전환 여정 - 발표자 : 박승전, Project Manager, ...
SK Telecom - 망관리 프로젝트 TANGO의 오픈소스 데이터베이스 전환 여정 - 발표자 : 박승전, Project Manager, ...SK Telecom - 망관리 프로젝트 TANGO의 오픈소스 데이터베이스 전환 여정 - 발표자 : 박승전, Project Manager, ...
SK Telecom - 망관리 프로젝트 TANGO의 오픈소스 데이터베이스 전환 여정 - 발표자 : 박승전, Project Manager, ...
 
AWS Summit Seoul 2023 | 바쁘다 바빠, 현대사회! Amazon Kendra로 원하는 자료를 적재적소에 찾아서 활용하기
AWS Summit Seoul 2023 | 바쁘다 바빠, 현대사회! Amazon Kendra로 원하는 자료를 적재적소에 찾아서 활용하기AWS Summit Seoul 2023 | 바쁘다 바빠, 현대사회! Amazon Kendra로 원하는 자료를 적재적소에 찾아서 활용하기
AWS Summit Seoul 2023 | 바쁘다 바빠, 현대사회! Amazon Kendra로 원하는 자료를 적재적소에 찾아서 활용하기
 
Cognitoハンズオン
CognitoハンズオンCognitoハンズオン
Cognitoハンズオン
 
[애플리케이션 현대화 및 개발] 클라우드를 통한 현대적 애플리케이션 디자인 및 구축 패턴 - 윤석찬, AWS 수석 테크 에반젤리스트
[애플리케이션 현대화 및 개발] 클라우드를 통한 현대적 애플리케이션 디자인 및 구축 패턴 - 윤석찬, AWS 수석 테크 에반젤리스트[애플리케이션 현대화 및 개발] 클라우드를 통한 현대적 애플리케이션 디자인 및 구축 패턴 - 윤석찬, AWS 수석 테크 에반젤리스트
[애플리케이션 현대화 및 개발] 클라우드를 통한 현대적 애플리케이션 디자인 및 구축 패턴 - 윤석찬, AWS 수석 테크 에반젤리스트
 
Enabling Agility with Data Governance - 발표자: 김성연, Analytics Specialist, WWSO,...
Enabling Agility with Data Governance - 발표자: 김성연, Analytics Specialist, WWSO,...Enabling Agility with Data Governance - 발표자: 김성연, Analytics Specialist, WWSO,...
Enabling Agility with Data Governance - 발표자: 김성연, Analytics Specialist, WWSO,...
 
Introduction to New CloudWatch Agent
Introduction to New CloudWatch AgentIntroduction to New CloudWatch Agent
Introduction to New CloudWatch Agent
 

Similaire à Amazon SageMaker를 이용한 예측 분석-남궁영환 솔루션즈 아키텍트, AWS

AWS 상에서 비즈니스를 수행하고자 하는 고객들에게 드리는 5가지 꿀팁 :: 정우근 :: AWS Summit Seoul 2018
AWS 상에서 비즈니스를 수행하고자 하는 고객들에게 드리는 5가지 꿀팁 :: 정우근 :: AWS Summit Seoul 2018AWS 상에서 비즈니스를 수행하고자 하는 고객들에게 드리는 5가지 꿀팁 :: 정우근 :: AWS Summit Seoul 2018
AWS 상에서 비즈니스를 수행하고자 하는 고객들에게 드리는 5가지 꿀팁 :: 정우근 :: AWS Summit Seoul 2018
Amazon Web Services Korea
 
AWS를 활용한 게임 데이터 분석 퀘스트 깨기::안효빈::AWS Summit Seoul 2018
AWS를 활용한 게임 데이터 분석 퀘스트 깨기::안효빈::AWS Summit Seoul 2018AWS를 활용한 게임 데이터 분석 퀘스트 깨기::안효빈::AWS Summit Seoul 2018
AWS를 활용한 게임 데이터 분석 퀘스트 깨기::안효빈::AWS Summit Seoul 2018
Amazon Web Services Korea
 
Serverless로 이미지 크롤링 프로토타입 개발기::유호균::AWS Summit Seoul 2018
Serverless로 이미지 크롤링 프로토타입 개발기::유호균::AWS Summit Seoul 2018Serverless로 이미지 크롤링 프로토타입 개발기::유호균::AWS Summit Seoul 2018
Serverless로 이미지 크롤링 프로토타입 개발기::유호균::AWS Summit Seoul 2018
Amazon Web Services Korea
 
유연하고 빠른 딥러닝 프레임워크 Apache MXNet::김무현::AWS Summit Seoul 2018
유연하고 빠른 딥러닝 프레임워크 Apache MXNet::김무현::AWS Summit Seoul 2018유연하고 빠른 딥러닝 프레임워크 Apache MXNet::김무현::AWS Summit Seoul 2018
유연하고 빠른 딥러닝 프레임워크 Apache MXNet::김무현::AWS Summit Seoul 2018
Amazon Web Services Korea
 

Similaire à Amazon SageMaker를 이용한 예측 분석-남궁영환 솔루션즈 아키텍트, AWS (20)

SageMaker를 활용한 엔터프라이즈 머신러닝 도입 및 프로세스 개선 방법 (김필호 AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS) ...
SageMaker를 활용한 엔터프라이즈 머신러닝 도입 및 프로세스 개선 방법 (김필호 AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS) ...SageMaker를 활용한 엔터프라이즈 머신러닝 도입 및 프로세스 개선 방법 (김필호 AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS) ...
SageMaker를 활용한 엔터프라이즈 머신러닝 도입 및 프로세스 개선 방법 (김필호 AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS) ...
 
개인화 추천 및 시계열 예측을 위한 신규 AI 서비스 살펴보기 - 남궁영환 AI/ML 스페셜리스트 솔루션즈 아키텍트 :: AWS Inno...
개인화 추천 및  시계열 예측을 위한 신규 AI 서비스 살펴보기 - 남궁영환 AI/ML 스페셜리스트 솔루션즈 아키텍트 :: AWS Inno...개인화 추천 및  시계열 예측을 위한 신규 AI 서비스 살펴보기 - 남궁영환 AI/ML 스페셜리스트 솔루션즈 아키텍트 :: AWS Inno...
개인화 추천 및 시계열 예측을 위한 신규 AI 서비스 살펴보기 - 남궁영환 AI/ML 스페셜리스트 솔루션즈 아키텍트 :: AWS Inno...
 
New SAP on AWS : AI 서비스로 SAP 비즈니스 프로세스를 자동화하기 - 이상규 (AWS 파트너 솔루션즈 아키텍트)
New SAP on AWS : AI 서비스로 SAP 비즈니스 프로세스를 자동화하기 - 이상규 (AWS 파트너 솔루션즈 아키텍트)New SAP on AWS : AI 서비스로 SAP 비즈니스 프로세스를 자동화하기 - 이상규 (AWS 파트너 솔루션즈 아키텍트)
New SAP on AWS : AI 서비스로 SAP 비즈니스 프로세스를 자동화하기 - 이상규 (AWS 파트너 솔루션즈 아키텍트)
 
[AWS Innovate 온라인 컨퍼런스] ML 모델 생성 및 운영 효율화를 높이는 Amazon SageMaker의 신규 기능들 - 남궁...
[AWS Innovate 온라인 컨퍼런스]  ML 모델 생성 및 운영 효율화를 높이는 Amazon SageMaker의 신규 기능들 - 남궁...[AWS Innovate 온라인 컨퍼런스]  ML 모델 생성 및 운영 효율화를 높이는 Amazon SageMaker의 신규 기능들 - 남궁...
[AWS Innovate 온라인 컨퍼런스] ML 모델 생성 및 운영 효율화를 높이는 Amazon SageMaker의 신규 기능들 - 남궁...
 
[AWS Innovate 온라인 컨퍼런스] Amazon Personalize를 통한 개인화 추천 기능 실전 구현하기 - 최원근, AWS 솔...
[AWS Innovate 온라인 컨퍼런스] Amazon Personalize를 통한 개인화 추천 기능 실전 구현하기 - 최원근, AWS 솔...[AWS Innovate 온라인 컨퍼런스] Amazon Personalize를 통한 개인화 추천 기능 실전 구현하기 - 최원근, AWS 솔...
[AWS Innovate 온라인 컨퍼런스] Amazon Personalize를 통한 개인화 추천 기능 실전 구현하기 - 최원근, AWS 솔...
 
Amazon SageMaker와 Athena를 활용한 대용량 자연어 처리 및 머신러닝 기법 (김필호, AWS AI Specialist 솔루...
Amazon SageMaker와 Athena를 활용한 대용량 자연어 처리 및 머신러닝 기법 (김필호, AWS AI Specialist 솔루...Amazon SageMaker와 Athena를 활용한 대용량 자연어 처리 및 머신러닝 기법 (김필호, AWS AI Specialist 솔루...
Amazon SageMaker와 Athena를 활용한 대용량 자연어 처리 및 머신러닝 기법 (김필호, AWS AI Specialist 솔루...
 
개인화 및 추천 기능의 맞춤형 AI 서비스 혁명: Amazon Personalize - 남궁영환 솔루션즈 아키텍트, AWS / 강성문 솔루...
개인화 및 추천 기능의 맞춤형 AI 서비스 혁명: Amazon Personalize - 남궁영환 솔루션즈 아키텍트, AWS / 강성문 솔루...개인화 및 추천 기능의 맞춤형 AI 서비스 혁명: Amazon Personalize - 남궁영환 솔루션즈 아키텍트, AWS / 강성문 솔루...
개인화 및 추천 기능의 맞춤형 AI 서비스 혁명: Amazon Personalize - 남궁영환 솔루션즈 아키텍트, AWS / 강성문 솔루...
 
AWS 상에서 비즈니스를 수행하고자 하는 고객들에게 드리는 5가지 꿀팁 :: 정우근 :: AWS Summit Seoul 2018
AWS 상에서 비즈니스를 수행하고자 하는 고객들에게 드리는 5가지 꿀팁 :: 정우근 :: AWS Summit Seoul 2018AWS 상에서 비즈니스를 수행하고자 하는 고객들에게 드리는 5가지 꿀팁 :: 정우근 :: AWS Summit Seoul 2018
AWS 상에서 비즈니스를 수행하고자 하는 고객들에게 드리는 5가지 꿀팁 :: 정우근 :: AWS Summit Seoul 2018
 
인공지능 / 기계학습 기반의 디지털 트랜스포메이션 및 글로벌 사례 - 김선수 사업개발 담당, AWS / 정진환 팀장, SK텔레콤 / 구태훈...
인공지능 / 기계학습 기반의 디지털 트랜스포메이션 및 글로벌 사례 - 김선수 사업개발 담당, AWS / 정진환 팀장, SK텔레콤 / 구태훈...인공지능 / 기계학습 기반의 디지털 트랜스포메이션 및 글로벌 사례 - 김선수 사업개발 담당, AWS / 정진환 팀장, SK텔레콤 / 구태훈...
인공지능 / 기계학습 기반의 디지털 트랜스포메이션 및 글로벌 사례 - 김선수 사업개발 담당, AWS / 정진환 팀장, SK텔레콤 / 구태훈...
 
AWS를 활용한 게임 데이터 분석 퀘스트 깨기::안효빈::AWS Summit Seoul 2018
AWS를 활용한 게임 데이터 분석 퀘스트 깨기::안효빈::AWS Summit Seoul 2018AWS를 활용한 게임 데이터 분석 퀘스트 깨기::안효빈::AWS Summit Seoul 2018
AWS를 활용한 게임 데이터 분석 퀘스트 깨기::안효빈::AWS Summit Seoul 2018
 
[AWS Innovate 온라인 컨퍼런스] Amazon Forecast를 통한 시계열 예측 활용하기 - 김종선, AWS 솔루션즈 아키텍트
[AWS Innovate 온라인 컨퍼런스] Amazon Forecast를 통한 시계열 예측 활용하기 - 김종선, AWS 솔루션즈 아키텍트[AWS Innovate 온라인 컨퍼런스] Amazon Forecast를 통한 시계열 예측 활용하기 - 김종선, AWS 솔루션즈 아키텍트
[AWS Innovate 온라인 컨퍼런스] Amazon Forecast를 통한 시계열 예측 활용하기 - 김종선, AWS 솔루션즈 아키텍트
 
데이터 과학자를 위한 신규 인공지능 서비스 - 김대근, 이유동, AWS AI/ML 스페셜리스트 솔루션즈 아키텍트 / 소성운, 카카오스타일 ...
데이터 과학자를 위한 신규 인공지능 서비스 - 김대근, 이유동, AWS AI/ML 스페셜리스트 솔루션즈 아키텍트 / 소성운, 카카오스타일 ...데이터 과학자를 위한 신규 인공지능 서비스 - 김대근, 이유동, AWS AI/ML 스페셜리스트 솔루션즈 아키텍트 / 소성운, 카카오스타일 ...
데이터 과학자를 위한 신규 인공지능 서비스 - 김대근, 이유동, AWS AI/ML 스페셜리스트 솔루션즈 아키텍트 / 소성운, 카카오스타일 ...
 
Amazon SageMaker 오버뷰 - 강성문, AWS AI/ML 스페셜리스트 :: AIML 특집 웨비나
Amazon SageMaker 오버뷰 - 강성문, AWS AI/ML 스페셜리스트 :: AIML 특집 웨비나Amazon SageMaker 오버뷰 - 강성문, AWS AI/ML 스페셜리스트 :: AIML 특집 웨비나
Amazon SageMaker 오버뷰 - 강성문, AWS AI/ML 스페셜리스트 :: AIML 특집 웨비나
 
핵심 미래 분석 기술! 시계열 분석을 활용한 수요예측과 재고관리 최적화 사례 – 김형일 AWS 솔루션즈 아키텍트, 이환기 신세계아이앤씨 A...
핵심 미래 분석 기술! 시계열 분석을 활용한 수요예측과 재고관리 최적화 사례 – 김형일 AWS 솔루션즈 아키텍트, 이환기 신세계아이앤씨 A...핵심 미래 분석 기술! 시계열 분석을 활용한 수요예측과 재고관리 최적화 사례 – 김형일 AWS 솔루션즈 아키텍트, 이환기 신세계아이앤씨 A...
핵심 미래 분석 기술! 시계열 분석을 활용한 수요예측과 재고관리 최적화 사례 – 김형일 AWS 솔루션즈 아키텍트, 이환기 신세계아이앤씨 A...
 
분석 워크로드 마이그레이션의 모든 것-김기영, AWS Analytics Specialist SA / 김성일, AWS Analytics Sp...
분석 워크로드 마이그레이션의 모든 것-김기영, AWS Analytics Specialist SA / 김성일, AWS Analytics Sp...분석 워크로드 마이그레이션의 모든 것-김기영, AWS Analytics Specialist SA / 김성일, AWS Analytics Sp...
분석 워크로드 마이그레이션의 모든 것-김기영, AWS Analytics Specialist SA / 김성일, AWS Analytics Sp...
 
AWS DeepRacer와 Amazon SageMaker RL로 강화학습 시작하기 - 강지양 솔루션즈 아키텍트, AWS
AWS DeepRacer와 Amazon SageMaker RL로 강화학습 시작하기 - 강지양 솔루션즈 아키텍트, AWSAWS DeepRacer와 Amazon SageMaker RL로 강화학습 시작하기 - 강지양 솔루션즈 아키텍트, AWS
AWS DeepRacer와 Amazon SageMaker RL로 강화학습 시작하기 - 강지양 솔루션즈 아키텍트, AWS
 
Serverless로 이미지 크롤링 프로토타입 개발기::유호균::AWS Summit Seoul 2018
Serverless로 이미지 크롤링 프로토타입 개발기::유호균::AWS Summit Seoul 2018Serverless로 이미지 크롤링 프로토타입 개발기::유호균::AWS Summit Seoul 2018
Serverless로 이미지 크롤링 프로토타입 개발기::유호균::AWS Summit Seoul 2018
 
유연하고 빠른 딥러닝 프레임워크 Apache MXNet::김무현::AWS Summit Seoul 2018
유연하고 빠른 딥러닝 프레임워크 Apache MXNet::김무현::AWS Summit Seoul 2018유연하고 빠른 딥러닝 프레임워크 Apache MXNet::김무현::AWS Summit Seoul 2018
유연하고 빠른 딥러닝 프레임워크 Apache MXNet::김무현::AWS Summit Seoul 2018
 
강의 4 - AWS 아키텍처 설계 (조재구 테크니컬 트레이너, AWS) :: AWSome Day 온라인 컨퍼런스 2018
강의 4 - AWS 아키텍처 설계 (조재구 테크니컬 트레이너, AWS) :: AWSome Day 온라인 컨퍼런스 2018강의 4 - AWS 아키텍처 설계 (조재구 테크니컬 트레이너, AWS) :: AWSome Day 온라인 컨퍼런스 2018
강의 4 - AWS 아키텍처 설계 (조재구 테크니컬 트레이너, AWS) :: AWSome Day 온라인 컨퍼런스 2018
 
AI/ML re:invent 2019 recap at Delivery Hero Korea
AI/ML re:invent 2019 recap at Delivery Hero KoreaAI/ML re:invent 2019 recap at Delivery Hero Korea
AI/ML re:invent 2019 recap at Delivery Hero Korea
 

Plus de Amazon Web Services Korea

Plus de Amazon Web Services Korea (20)

AWS Modern Infra with Storage Roadshow 2023 - Day 2
AWS Modern Infra with Storage Roadshow 2023 - Day 2AWS Modern Infra with Storage Roadshow 2023 - Day 2
AWS Modern Infra with Storage Roadshow 2023 - Day 2
 
AWS Modern Infra with Storage Roadshow 2023 - Day 1
AWS Modern Infra with Storage Roadshow 2023 - Day 1AWS Modern Infra with Storage Roadshow 2023 - Day 1
AWS Modern Infra with Storage Roadshow 2023 - Day 1
 
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
 
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
 
Amazon Elasticache - Fully managed, Redis & Memcached Compatible Service (Lev...
Amazon Elasticache - Fully managed, Redis & Memcached Compatible Service (Lev...Amazon Elasticache - Fully managed, Redis & Memcached Compatible Service (Lev...
Amazon Elasticache - Fully managed, Redis & Memcached Compatible Service (Lev...
 
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
 
[Keynote] 슬기로운 AWS 데이터베이스 선택하기 - 발표자: 강민석, Korea Database SA Manager, WWSO, A...
[Keynote] 슬기로운 AWS 데이터베이스 선택하기 - 발표자: 강민석, Korea Database SA Manager, WWSO, A...[Keynote] 슬기로운 AWS 데이터베이스 선택하기 - 발표자: 강민석, Korea Database SA Manager, WWSO, A...
[Keynote] 슬기로운 AWS 데이터베이스 선택하기 - 발표자: 강민석, Korea Database SA Manager, WWSO, A...
 
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
 
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
 
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
 
Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...
Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...
Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...
 
From Insights to Action, How to build and maintain a Data Driven Organization...
From Insights to Action, How to build and maintain a Data Driven Organization...From Insights to Action, How to build and maintain a Data Driven Organization...
From Insights to Action, How to build and maintain a Data Driven Organization...
 
[Keynote] Accelerating Business Outcomes with AWS Data - 발표자: Saeed Gharadagh...
[Keynote] Accelerating Business Outcomes with AWS Data - 발표자: Saeed Gharadagh...[Keynote] Accelerating Business Outcomes with AWS Data - 발표자: Saeed Gharadagh...
[Keynote] Accelerating Business Outcomes with AWS Data - 발표자: Saeed Gharadagh...
 
Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...
Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...
Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...
 
코리안리 - 데이터 분석 플랫폼 구축 여정, 그 시작과 과제 - 발표자: 김석기 그룹장, 데이터비즈니스센터, 메가존클라우드 ::: AWS ...
코리안리 - 데이터 분석 플랫폼 구축 여정, 그 시작과 과제 - 발표자: 김석기 그룹장, 데이터비즈니스센터, 메가존클라우드 ::: AWS ...코리안리 - 데이터 분석 플랫폼 구축 여정, 그 시작과 과제 - 발표자: 김석기 그룹장, 데이터비즈니스센터, 메가존클라우드 ::: AWS ...
코리안리 - 데이터 분석 플랫폼 구축 여정, 그 시작과 과제 - 발표자: 김석기 그룹장, 데이터비즈니스센터, 메가존클라우드 ::: AWS ...
 
LG 이노텍 - Amazon Redshift Serverless를 활용한 데이터 분석 플랫폼 혁신 과정 - 발표자: 유재상 선임, LG이노...
LG 이노텍 - Amazon Redshift Serverless를 활용한 데이터 분석 플랫폼 혁신 과정 - 발표자: 유재상 선임, LG이노...LG 이노텍 - Amazon Redshift Serverless를 활용한 데이터 분석 플랫폼 혁신 과정 - 발표자: 유재상 선임, LG이노...
LG 이노텍 - Amazon Redshift Serverless를 활용한 데이터 분석 플랫폼 혁신 과정 - 발표자: 유재상 선임, LG이노...
 
[Keynote] Data Driven Organizations with AWS Data - 발표자: Agnes Panosian, Head...
[Keynote] Data Driven Organizations with AWS Data - 발표자: Agnes Panosian, Head...[Keynote] Data Driven Organizations with AWS Data - 발표자: Agnes Panosian, Head...
[Keynote] Data Driven Organizations with AWS Data - 발표자: Agnes Panosian, Head...
 
AWS Summit Seoul 2023 | 생성 AI 모델의 임베딩 벡터를 이용한 서버리스 추천 검색 구현하기
AWS Summit Seoul 2023 | 생성 AI 모델의 임베딩 벡터를 이용한 서버리스 추천 검색 구현하기AWS Summit Seoul 2023 | 생성 AI 모델의 임베딩 벡터를 이용한 서버리스 추천 검색 구현하기
AWS Summit Seoul 2023 | 생성 AI 모델의 임베딩 벡터를 이용한 서버리스 추천 검색 구현하기
 
AWS Summit Seoul 2023 | 스타트업의 서버리스 기반 SaaS 데이터 처리 및 데이터웨어하우스 구축 사례
AWS Summit Seoul 2023 | 스타트업의 서버리스 기반 SaaS 데이터 처리 및 데이터웨어하우스 구축 사례AWS Summit Seoul 2023 | 스타트업의 서버리스 기반 SaaS 데이터 처리 및 데이터웨어하우스 구축 사례
AWS Summit Seoul 2023 | 스타트업의 서버리스 기반 SaaS 데이터 처리 및 데이터웨어하우스 구축 사례
 
AWS Summit Seoul 2023 | Amazon EKS 데이터 전송 비용 절감 및 카오스 엔지니어링 적용 사례
AWS Summit Seoul 2023 | Amazon EKS 데이터 전송 비용 절감 및 카오스 엔지니어링 적용 사례AWS Summit Seoul 2023 | Amazon EKS 데이터 전송 비용 절감 및 카오스 엔지니어링 적용 사례
AWS Summit Seoul 2023 | Amazon EKS 데이터 전송 비용 절감 및 카오스 엔지니어링 적용 사례
 

Amazon SageMaker를 이용한 예측 분석-남궁영환 솔루션즈 아키텍트, AWS

  • 1. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon SageMaker를 이용한 예측 분석 남궁 영환 AI/ML Specialist Solutions Architect Amazon Web Services
  • 2. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. 강연 중 질문하는 방법 Go to Webinar “Questions” 창에 자신이 질문한 내역이 표시됩니다. 기본적으로 모든 질문은 공개로 답변 됩니다만 본인만 답변을 받고 싶으면 (비공개)라고 하고 질문해 주시면 됩니다. 본 컨텐츠는 고객의 편의를 위해 AWS 서비스 설명을 위해 온라인 세미나용으로 별도로 제작, 제공된 것입니다. 만약 AWS 사이트와 컨텐츠 상에서 차이나 불일치가 있을 경우, AWS 사이트(aws.amazon.com)가 우선합니다. 또한 AWS 사이트 상에서 한글 번역문과 영어 원문에 차이나 불일치가 있을 경우(번역의 지체로 인한 경우 등 포함), 영어 원문이 우선합니다. AWS는 본 컨텐츠에 포함되거나 컨텐츠를 통하여 고객에게 제공된 일체의 정보, 콘텐츠, 자료, 제품(소프트웨어 포함) 또는 서비스를 이용함으로 인하여 발생하는 여하한 종류의 손해에 대하여 어떠한 책임도 지지 아니하며, 이는 직접 손해, 간접 손해, 부수적 손해, 징벌적 손해 및 결과적 손해를 포함하되 이에 한정되지 아니합니다. 고지 사항(Disclaimer)
  • 3. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Agenda • Amazon & AWS의 AI/ML • Amazon SageMaker  주요 특징  Hyperparameter Tuning  빌트인 알고리즘 • 시계열 예측 분석 • Demo
  • 4. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. 인공지능 & 머신러닝 유스케이스의 폭발적인 증가 이미지 인식 및 태깅 (예: 효율적인 사진 정리) 객체 탐지, 트래킹, 내비게이션 (예: 자율 주행 차량 기술) 음성 인식 및 합성 (예: 지능형 음성 비서 기술) 알고리즘 기반 트레이딩 전략 관련 성능 향상 감성 분석 (예: 개인화 및 맞춤형 광고 기술) AI (Artificial Intelligence) ML (Machine Learning)
  • 5. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon의 머신러닝(ML) 관련 주요 분야 물류 및 재고 관리 검색/추천 기존 상품 관리 효율화 신규 상품 맞춤형 제시 AWS
  • 6. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. ML @ AWS OUR MISSION 전세계 모든 데이터 과학자와 개발자에게 편리한 머신 러닝 연구 개발 환경을 제공
  • 7. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS 상에서 머신 러닝을 활용하고 있는 고객
  • 8. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon ML stack Frameworks & Infrastructure Application Services Managed Platform Services KERAS A W S D E E P L E A R N I N G A M I A M A Z O N S A G E M A K E R R E K O G N I T I O N R E K O G N I T I O N V I D E O P O L L Y T R A N S C R I B E T R A N S L A T E C O M P R E H E N D L E X S P E E C H L A N G U A G E A W S D E E P L E N S A M A Z O N M A C H I N E L E A R N I N G S P A R K & E M R A M A Z O N M E C H A N I C A L T U R K G P U ( P 3 I N S T A N C E S ) C P U I O T ( G R E E N G R A S S ) M O B I L E V I S I O N
  • 9. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon SageMaker
  • 10. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. 머신 러닝 프로세스 Data Visualization & Analysis Business Problem – Data Collection Data Integration Data Preparation & Cleaning Feature Engineering Model Training & Parameter Tuning Model Evaluation Are Business Goals met? Model Deployment Monitoring & Debugging – Predictions YesNo DataAugmentation Feature Augmentation Re-training ML problem framing
  • 11. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon SageMaker 손쉽게 머신 러닝 모델을 빌드, 트레이닝, 배포할 수 있는 완전 관리형 서비스 머신러닝 모델을 위한 트레이닝 데이터 수집 및 준비 머신 러닝 알고리즘 선정 및 최적화 머신 러닝 모델 트레이닝을 위한 환경 세팅 및 관리 머신 러닝 모델의 트레이닝 & 튜닝 (반복 개선 과정) 머신 러닝 모델의 프로덕션 환경 배포 프로덕션 환경에서 운영, 확장 및 관리
  • 12. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Bring Your Own Algorithms ML Algorithms R MXNet TensorFlow Caffe/Caffe2 PyTorch Keras CNTK … Amazon SageMaker를 이용한 ML 모델 트레이닝 SageMaker Built- in Algorithms k-Means Clustering PCA Neural Topic Modelling Factorization Machines Linear Learner XGBoost Latent Dirichlet Allocation Image Classification Seq2Seq DeepAR Forecasting BlazingText (word2vec) Random Cut Forest k-Nearest Neighbour Object Detection SageMaker Framework SDKs TensorFlow SDK MXNet (Gluon) SDK Chainer SDK PyTorch SDK Apache Spark Estimator Apache Spark Python library Apache Spark Scala library Amazon EMR
  • 13. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon SageMaker: 참조 아키텍처 SageMaker Notebooks Training Algorithm SageMaker Training SageMaker Hosting AWS Lambda API Gateway 데이터 준비 Training Data Inference requests Amazon S3 Amazon S3 트레이닝 & 튜닝 호스팅 & 배포 Raw Data Prepared Data Algorithm Container Trained Model Trained Model Hyperparameter Optimization User Interactions
  • 14. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Photo credit: https://www.flickr.com/photos/ceasedesist/5821282085 (Licensed for commercial use) Hyperparameter Tuning
  • 15. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hyperparameter Tuning Image Classification 알고리즘 최적의 하이퍼파라미터로 트레이닝한 결과 label – bathtub probability - 0.998812198638916 최초의 하이퍼파라미터로 트레이닝한 결과
  • 16. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hyperparameter Tuning Learning Rate Regularization Option 1: 그리드 탐색 (Grid Search)
  • 17. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hyperparameter Tuning Option 1: 그리드 탐색 (Grid Search) gamma : Kernel coefficient for ‘rbf’, ‘poly’, and ‘sigmoid’ C: Penalty parameter * SVC: Support Vector Clustering
  • 18. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hyperparameter Tuning Option 2: 랜덤 탐색 (Random Search) Learning Rate Regularization Bergstra, Bengio, “Random Search for Hyper-Parameter Optimization” https://dl.acm.org/citation.cfm?id=2188395 "그리드 탐색(Grid search)을 이용하는 뉴럴 네트워크와 비교했을 때, 동일한 문제와 모델에 랜덤 탐색 (Random search)을 이용하면 전체적으로 모델의 성능도 더 향상되고 계산 시간도 더 빨라짐 "
  • 19. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hyperparameter Tuning Option 2: 랜덤 탐색 (Random Search)
  • 20. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hyperparameter Tuning Option 3: Bayesian Optimization 기법 • A Tutorial on Bayesian Optimization of Expensive Cost Functions, with Application to Active User Modeling and Hierarchical Reinforcement Learning (https://arxiv.org/abs/1012.2599) • Practical Bayesian Optimization of Machine Learning Algorithms (https://arxiv.org/abs/1206.2944) • Taking the Human Out of the Loop: A Review of Bayesian Optimization (https://ieeexplore.ieee.org/document/7352306)
  • 21. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hyperparameter Tuning in Amazon SageMaker Amazon SageMaker의 Hyperparameter Tuning 기능은 Bayesian Optimization을 포함한 몇 가지 다양한 최적화 기법을 바탕으로 구현되어 있습니다.
  • 22. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hyperparameter Tuning in Amazon SageMaker Hyperparameter tuning finds the best hyperparameter using Bayesian optimization 모든 ML 알고리즘을 지원합니다: • SageMaker의 빌트인 알고리즘 • 사용자 정의 알고리즘 • ML 프레임워크를 위해 Amazon SageMaker 상에서 사전에 빌드한 컨테이너 (TensorFlow, MXNet, Chainer) = bring-your-own-container 트레이닝 데이터셋 ML 알고리즘 Objective 선별된 Hyperparameters 가장 좋은 결과를 얻기 위한 Hyperparameter들을 추정 채택된 hyperparameters를 이용한 모델 트레이닝 가장 좋은 모델을 결과로 리턴 Configuration Bayesian Optimization Training Jobs
  • 23. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hyperparameter Tuning in Amazon SageMaker Configuration Training Jobs The result of models Estimator
  • 24. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hyperparameter Tuning in Amazon SageMaker Automatic Model Tuning
  • 25. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hyperparameter Tuning in Amazon SageMaker Automatic Model Tuning
  • 26. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hyperparameter Tuning in Amazon SageMaker Automatic Model Tuning
  • 27. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hyperparameter Tuning in Amazon SageMaker Automatic Model Tuning
  • 28. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. SageMaker의 빌트인 알고리즘들
  • 29. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. 대규모 데이터 및 성능 향상에 최적화된 알고리즘 Amazon SageMaker 는 대용량 데이터 처리/분석 및 최적화된 성능을 지원하는 빌트인 알고리즘을 제공하며 지속적 추가 및 업데이트를 제공합니다. Amazon provided algorithm Sample Use Cases K-Means clustering 고객 군 분할; 분류 K-Nearest Neighbors 분류 또는 회귀에 사용되는 비모수 방식의 알고리즘 Principal Component Analysis 특징 차원 감소 Factorization Machines 추천 시스템 Linear regression 가격 예측 Binary classification 탈퇴 고객 예측 Latent Dirichlet Allocation 토픽에 따른 문서 분류 Neural Variational Document Model (NVDM) 자연어 처리를 이용한 문서 분류 XGboost Decision trees; 비정형 파악 Image Classifier (ResNet) 이미지를 구분하는 알고리즘 Object Detection Algorithm (SSD) 하나의 이미지로부터 다양한 물체를 찾아내고 인식하는 알고리즘 Sequence2Sequence 언어 번역 DeepAR RNN을 이용한 시계열 데이터 예측 BlazingText Word2Vec 구현; 자연어 처리를 위해 단어를 벡터로 변환 Random Cut Forest 비정상적인 데이터 추출
  • 30. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Linear Learner • Classification, Regression 문제에 활용 • 다양한 Objective metric 이용 가능 • Continuous: mean square error, cross entropy loss, absolute error • Discrete: f1, precision-recall, accuracy • SGD, Adam, Adagrad, rmsprop 등의 최적화 알고리즘 지원 • Preprocessing 지원 • unbias_data: 평균값을 0으로 • normalize_data: standard deviation을 1로 • 입력 데이터는 섞여(shuffled) 있어야 함. (레이블 순서대로 정렬된 데이터를 사용할 경우, 정상적인 모델 트레이닝이 안 됨) • Multi-class Classification 지원 • Auto ML Tuning 관련 • Linear Learner는 Auto ML Tuning 기능과는 별도로 hyperparameter 튜닝을 위한 내부 메카니즘을 보유하고 있음 (기본적으로, 여러 모델을 병렬로 트레이닝해서 Hyperparameter를 튜닝함) • Auto ML Tuning 기능을 사용할 경우, 기본 Hyperparameter 튜닝 기능은 자동 차단됨 𝑌𝑖 = 𝛽0 + 𝛽1 𝑋𝑖 + 𝜀𝑖 Dependent Variable Random Error term Population Y intercept Population Slope coefficient Independent Variable https://towardsdatascience.com/linear-regression-in-python-9a1f5f000606 https://seaborn.pydata.org/examples/multiple_regression.html
  • 31. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Factorization Machines • SVM (Support Vector Machines) 알고리즘의 장점에 Factorization 모델링을 결합한 예측 알고리즘 • 많은 feature들을 가진 sparse 데이터셋을 다룰 때 효과적임 (예. 클릭 예측과 상품 추천) • Dense한 데이터를 다룰 때에만 GPU를 사용하세요. • Float32 tensors로 구성된 recordIO-protobuf 포맷을 지원합니다. • FYI, see “Implementing a Recommender System with SageMaker, MXNet, and Gluon(GitHub)” Sparse 데이터 셋 예제 Factorization Machine 모델 ො𝑦 = 𝑤0 + ෍ 𝑖 𝑤𝑖 𝑥𝑖 + ෍ 𝑖 ෍ 𝑗>𝑖 < 𝑣𝑖, 𝑣𝑗 > 𝑥𝑖 𝑥𝑗 Cost Function 𝐿 = 1 𝑁 ෍ 𝑛 𝑦𝑛 − ො𝑦𝑛 2
  • 32. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Boosted Decision Trees • XGBoost (eXtreme Gradient Boosting)은 오픈 소스 기반의 Gradient boosted trees 알고리즘 • 다양한 분야에서 폭넓게 활용 중 (매출 예측, 웹 문서 구분, 고객 행동 예측, 모션 예측, 광고 클릭률 예측, Malware 구분, 제품 분류, 위험 예측 등) • 현재는 libSVM 과 CSV 포맷을 지원 (Protobuf 아님) What is the best split? Tree ensemble model ? https://homes.cs.washington.edu/~tqchen/pdf/BoostedTree.pdf
  • 33. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Boosted Decision Trees Tunable Hyperparameters 각 Parameter들의 의미와 역할을 이해하고 문제에 잘 맞도록 적용하는 것이 중요합니다. Metric Name Description Optimization Direction validation:rmse Root mean square error. Minimize validation:mae Mean absolute error. You must choose one of them as an objective to optimize when tuning the algorithm with hyperparameter values.>Minimize validation:logloss Negative log-likelihood. Minimize validation:error Binary classification error rate, calculated as #(wrong cases)/#(all cases). Minimize validation:merror Multiclass classification error rate, calculated as #(wrong cases)/#(all cases). Minimize validation:mlogloss Negative log-likelihood for multiclass classification. Minimize validation:auc Area under the curve. Maximize validation:ndcg Normalized Discounted Cumulative Gain. Maximize validation:map Mean average precision. Maximize Metrics Computed by the XGBoost Algorithm Parameter Name Parameter Type Recommended Ranges num_round IntegerParameterRanges [1, 4000] eta ContinuousParameterRange s MinValue: 0.1, MaxValue: 0.5 gamma ContinuousParameterRange s MinValue: 0, MaxValue: 5 max_depth IntegerParameterRanges [0, 10] min_child_weight ContinuousParameterRange s MinValue: 0, MaxValue: 120 max_delta_step IntegerParameterRanges [0, 10] subsample ContinuousParameterRange s MinValue: 0.5, MaxValue: 1 colsample_bytree ContinuousParameterRange s MinValue: 0.5, MaxValue: 1 colsample_bylevel ContinuousParameterRange s MinValue: 0.5, MaxValue: 1 lambda ContinuousParameterRange s MinValue: 0, MaxValue: 1000 alpha ContinuousParameterRange s MinValue: 0, MaxValue: 1000 (Choose one of these metrics as the objective) (alpha, min_child_weight, subsample, eta, and num_round, etc.)
  • 34. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. KNN: K-Nearest Neighbors • 비모수(non-parametric) 방식의 인덱스 기반 알고리즘  분류(Classification): 샘플 데이터와 가장 가까운 k개의 데이터 포인트를 대상으로 가장 많이 나타난 클래스 레이블을 할당  회귀(Regression): 샘플 데이터와 가장 가까운 k개의 데이터 포인트를 대상으로, 피처 값의 평균을 결과로 리턴 • k-NN 알고리즘은 3단계로 구성되어 있습니다.  샘플링: 초기의 데이터 크기를 메모리에 맞게 줄임 (sample_size)  차원 축소: 데이터의 차원을 줄여나가는 단계 - 목적: 사용되는 메모리 크기 & 추론에 소요되는 시간을 줄이기 위해 - Random projection (sign) 모드, fast Johnson-Lindenstrauss transform(fjlt) 모드를 지원  인덱스 구축: 최종단계에서 구축된 인덱스가 데이터들간의 거리를 효과적으로 Lookup 할 수 있게 함. (인덱스 타입 (index_type) 으로 flat index, inverted index 와 inverted index with product quantization 세가지 모드를 지원) • 트레이닝을 위한 데이터는 recordIO-protobuf 와 CSV 포맷을 지원 • Batch transform 모드에서는 application/jsonlines 데이터 포맷을 지원
  • 35. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Random Cut Forest • 데이터셋내에서 비정상적인 데이터를 찾아내는 Unsupervised learning 방식의 알고리즘 • 시계열 데이터내에서 spikes, 데이터의 주기성을 깨는 데이터, 분류를 할 수 없는 데이터 값들을 검출 • 각 데이터에 대해서 anomaly 스코어를 계산 (스코어가 높을수록 비정상일 확률이 높음을 의미) • Amazon SageMaker의 RCF는 다차원 데이터를 지원하며 feature 개수, big data, 그리고 instance의 scalability가 뛰어남 • CPU에 최적화 되어 있음 Robust Random Cust Forest Based Anomaly Detection on Streams http://proceedings.mlr.press/v48/guha16.pdf
  • 36. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. DeepAR • scalar 타입의 시계열(Time-series) 데이터를 RNN (Recurrent Neural Network)을 기반으로 예측하는 알고리즘 • train과 test의 2 채널을 지원합니다. prediction_length는 고정값입니다. • 학습을 위한 데이터는 .json 과 .parquet 포맷을 지원합니다. • CPU와 GPU 모두 지원합니다. • Category값을 지원하여 (“cat”) 시계열 그룹의 특징들을 학습할 수 있습니다. zi ,t − 2, xi ,t − 1 zi ,t − 1, xi ,t zi ,t , xi ,t + 1 hi ,t − 1 hi ,t hi ,t + 1 `(zi ,t − 1|✓i ,t − 1) `(zi ,t |✓i ,t ) `(zi ,t + 1|✓i ,t + 1) zi ,t − 1 zi ,t zi ,t + 1 Input Network
  • 37. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Time-series Forecasting
  • 38. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Time-series Forecasting - overview Multi-step 𝒴𝑡+𝑘𝒴:𝑡 Covariates 𝒴𝑡+𝑘𝒴:𝑡, 𝑥:𝑡 (ℎ) , 𝑥:𝑡 (𝑓) , 𝑥(𝑠) Multi time series 𝒴:𝑡 𝑖𝒴:𝑡 One-step-ahead 𝒴𝑡+1𝒴:𝑡 = (𝒴𝑡, ⋯ , 𝒴0) Probabilistic Forecasting 𝑝 𝒴𝑡+𝑘|𝒴:𝑡𝔼(𝒴𝑡+𝑘|𝒴:𝑡)
  • 39. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Multi-step forecasting variants Direct … Recursive • AR(autoregressive) 방법과 유사 • 시스템에서 다음 단계의 추정 결과를 ‘Ground Truth’로 간주해서 반복적으로 계산 • 트레이닝/예측의 차이를 보정하기 위한 정교한 트레이닝 기법이 필요 * * Bengio et al., Scheduled Sampling for Sequence Prediction with Recurrent Neural Networks (2015) **Taieb and Atiya, A Bias and Variance Analysis for Multi-Step-Ahead Time Series Forecasting (2016) • 과거 이력을 바탕으로 를 바로 예측 • 과거 이력과 예측하려는 값 사이의 time step들은 무시 • More stable, less biased, more robust**
  • 40. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Multi-step forecasting variants • Temporal covariates available in history • 예: demand, usage, weather, etc. • Temporal covariates available in history & future • 예: Holidays, supply, prices, promotions, weather, etc. • ‘What-if’ 시나리오를 참고 • Static covariates • 예: location, country, store ID, etc. y x History Future
  • 41. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Probabilistic Forecasting Point forecast Parametric • 가정: 데이터가 특정 확률 분포를 따름을 전제로 함 • 아래의 likelihood loss function을 통해 바로 답을 계산할 수 있는 파라미터셋을 예측 Non-parametric • 예를 들어, 다음의 확률을 예측하는 Quantile 회귀 함수를 만들고 싶다면? • 아래와 같은 전체 Quantile 손실 함수값이 최소가 되도록 구현해야 함 Probabilistic forecast 𝑝 𝒴𝑡+𝑘|𝒴:𝑡𝔼(𝒴𝑡+𝑘|𝒴:𝑡) ℒ = ෍ 𝑖=1 𝑁 ෍ 𝑡=𝑡0 𝑇 log⁡ ℓ(𝑧𝑖,𝑡|𝜃(𝐡𝑖,𝑡))
  • 42. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Learning from multiple related timeseries Neural Network 기법이 시계열 예측 분야에서 뛰어난 성능을 나타냄: • very long history • many covariates • complex and non-linear relationships (spatial and temporal) • multiple related timeseries
  • 43. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Data Generators for time series training … 1 4 3 2 -1 0 3 2 6 4 4 … … 3 2 5 4 6 -2 5 0 -4 2 4 … Lookback = 4 Step = 2 Delay = 4 2 0 2 4 4 -2 0 Generator y x1 y x1
  • 44. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. From Dense to Recurrent Nets 2 0 2 4 -2 0 y x1 y x1 2 0 2 4 -2 0 Flatten
  • 45. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. From Dense to Recurrent Nets y x1 2 0 2 4 -2 0 4 • Flattening the timeseries loses temporal correlation • The dense net requires a lot of date to rediscover these relationships (it can) • Is there a way to preserve temporal information?
  • 46. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. From Dense to Recurrent Nets 2 0 2 4 -2 0 𝑥<𝑡> 𝑥<𝑡+1> 𝑥<𝑡−1>
  • 47. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. The simple recurrent memory cell 𝑥<𝑡> 𝑥<𝑡+1> 𝑥<𝑡−1> 𝑦<𝑡−1> 𝑦<𝑡> 𝑦<𝑡+1> 𝑎<𝑡−1> 𝑎<𝑡> 2 0 2 4 -2 0 4
  • 48. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. The simple recurrent memory cell 4 𝑎<𝑡> = 𝑔(𝑊𝑎𝑥 𝑥<𝑡> + 𝑊𝑎𝑎 𝑎<𝑡−1> + 𝑏 𝑎) 𝑦<𝑡> = 𝑔(𝑊𝑦𝑎 𝑎<𝑡> + 𝑏 𝑦) Vanishing Gradients! 𝑥<𝑡> 𝑥<𝑡+1> 𝑥<𝑡−1> 𝑦<𝑡−1> 𝑦<𝑡> 𝑦<𝑡+1> 𝑎<𝑡−1> 𝑎<𝑡> 2 0 2 4 -2 0
  • 49. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. LSTM: Long Short-Term memory * Hochreiter, Sepp, and Jürgen Schmidhuber. “Long Short-Term Memory.” Neural Computation 9, no. 8 (November 1, 1997): 1735–80. https://doi.org/10.1162/neco.1997.9.8.1735.
  • 50. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. LSTM cell xt Ht-1 Ct-1 Previous Cell State Previous Hidden State Output Current Input Ct Ht Ht Current Cell State Current Hidden State Output Current Hidden State Output X + ot ft X it gt X Tanh Ct Input Gate Tanh Output GateForget Gate 𝜎 𝜎𝜎
  • 51. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. LSTM Network LSTM Cell LSTM Cell LSTM Cell LSTM Cell LSTM Cell Xt-2 xt Xt+2Xt-1 Xt+1 Temporal Sequence Input Ht-2 LSTM Layer Hidden State Output Ht Ht+2Ht-1 Ht+1
  • 52. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. The Gated Recurrent Unit (GRU) Cell
  • 53. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Summary of RNN types One to many 𝑎<0> 𝑥 ො𝑦<1> ො𝑦<2> ො𝑦<𝑇𝑦> ⋯ 𝑥<2> 𝑥<𝑇𝑥> 𝑎<0> 𝑥<1> ො𝑦 ⋯ Many to one 𝑎<0> 𝑥<1> ො𝑦<𝑇𝑦> ⋯ 𝑥<2> 𝑥<𝑇𝑥> ො𝑦<1> ො𝑦<2> Many to many (Seq2Seq) Many to many (delayed Seq2Seq) ⋯ ⋯𝑎<0> 𝑥<1> ො𝑦<1> ⋯ 𝑥<𝑇𝑥> ො𝑦<𝑇𝑦>
  • 54. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. DeepAR* * Flunkert, Valentin, David Salinas, and Jan Gasthaus. “DeepAR: Probabilistic Forecasting with Autoregressive Recurrent Networks.” ArXiv:1704.04110 [Cs, Stat], April 13, 2017. http://arxiv.org/abs/1704.04110. • Amazon SageMaker 에서 시계열 예측 분석을 위한 RNN 아키텍처 (완전 관리형, 뛰어난 확장성, 높은 정확도) • 특정 시점 예측 및 확률 기반 예측 (다양한 노이즈 모델들 중 선택 가능) 지원 • 트레이닝 데이터 내의 여러 가지 관련 시계열을 기반으로 한 학습 (cold start problem) • Recursive Multi-Horizon 및 static categorical variables 지원 • Amazon에서 매우 중요한 의사결정 문제들을 해결하는 과정 중 만들어진 알고리즘
  • 55. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. DeepAR* * Flunkert, Valentin, David Salinas, and Jan Gasthaus. “DeepAR: Probabilistic Forecasting with Autoregressive Recurrent Networks.” ArXiv:1704.04110 [Cs, Stat], April 13, 2017. http://arxiv.org/abs/1704.04110. Training Prediction ancestral sampling Encoder DecoderSeq2Seq t0 likelihood sampling likelihoo d 𝐡𝑖,𝑡0−1
  • 56. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Likelihood model of DeepAR Neural network predicts all parameters (e.g. mean and variance) of likelihood function For the experiments, two choices: • Gaussian likelihood: real-valued data • Negative binomial likelihood: positive count data
  • 57. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Example Demand Forecasts • Figure 1: cold start scenario. Since the model shares information across items, predictions are reasonable even with limited historic data. • Figure 2 & 3: probabilistic forecasts for products with different magnitudes by using an appropriate likelihood function (Negative Binomial).
  • 58. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Demo: Amazon SageMaker
  • 59. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. 참고 링크 • Getting started with Amazon SageMaker를 통한 실습: • https://aws.amazon.com/sagemaker/ • Amazon SageMaker SDK 사용법 익히기: • For Python: https://github.com/aws/sagemaker-python-sdk • For Spark: https://github.com/aws/sagemaker-spark • SageMaker Code Samples / Workshops: • https://github.com/awslabs/amazon-sagemaker-examples • https://github.com/awslabs/amazon-sagemaker-workshop
  • 60. © 2018 Amazon Web Services, Inc. or its Affiliates. All rights reserved. 더 나은 세미나를 위해 여러분의 의견을 남겨주세요! 웨비나 종료 후 설문이 시작됩니다.  질문에 대한 답변 드립니다.  발표자료 / 녹화 영상을 제공합니다. http://bit.ly/awskr-webinar AWS 데이터 기반 의사결정 웹세미나에 참석해주셔서 대단히 감사합니다.