Applicazioni di Intelligenza artificiale con AWS Lambda.
L'analisi dei dati e la progettazione di modelli di Machine Learning spesso sono la parte più "facile" nella vita di un data scientist. La vera sfida inizia quando il prototipo deve diventare production-ready: come garantire scalabilità e performance senza compromettere velocità di esecuzione e flessibilità?
Analizzeremo insieme pro e contro delle due soluzioni più promettenti: MLaaS (Machine Learning as a Service) e Serverless (e.g. AWS Lambda).
3. What is Machine Learning?
Back to 1959 (Arthur Samuel)
How computers learn from Data
How to solve decision problems
AWS @ Romeclda.co/aws-‐roma
4. Machine Learning pipeline
Training Predic3on
batch real-‐Cme
Feature
extrac3on
batch
data informa:on
features ML models
AWS @ Romeclda.co/aws-‐roma
9. What problems can ML solve for you?
Supervised
Learning
Unsupervised
Learning
classifica'on
regression
clustering
rule extrac'on
?
170
cm
gro gro
A, B C
AWS @ Romeclda.co/aws-‐roma
10. What problems can ML solve for you?
Supervised
Learning
Unsupervised
Learning
classifica'on
regression
clustering
rule extrac'on
?
fraud detec:on
170
cm
gro gro
A, B C
price of a stock over :me
purchase likelihood
user segmenta:on
AWS @ Romeclda.co/aws-‐roma
12. Generated data started growing ~10 years ago…
“90% of the data in the world today has been
created in the last two years alone” -‐ IBM
“300+ hours worth of video content is being
uploaded to the site every minute” -‐ Youtube
AWS @ Romeclda.co/aws-‐roma
13. … and it keeps geMng bigger!
AWS @ Romeclda.co/aws-‐roma
14. Big data challenges
Manual explora:on is not an op:on
Data-‐driven decisions are a must
Distributed/parallel compu:ng
The curse of dimensionality
AWS @ Romeclda.co/aws-‐roma
17. Why is deploying ML models a challenge?
AWS @ Romeclda.co/aws-‐roma
18. Why is deploying ML models a challenge?
AWS @ Romeclda.co/aws-‐roma
+
+
Data
Scien:st
Data
Time
19. Why is deploying ML models a challenge?
AWS @ Romeclda.co/aws-‐roma
+
+
Data
Scien:st
Data
Time
ML
Model
Data
Visualisa:on
Prototype
+
+
20. Why is deploying ML models a challenge?
AWS @ Romeclda.co/aws-‐roma
Produc:on
Code
+
+
Data
Scien:st
Data
Time
ML
Model
Data
Visualisa:on
Prototype
+
+
21. Why is deploying ML models a challenge?
AWS @ Romeclda.co/aws-‐roma
+
+
Data
Scien:st
Data
Time
ML
Model
Data
Visualisa:on
Prototype
+
+
Web
Developer
DevOps
A lot of
Time
+
+
22. Why is deploying ML models a challenge?
1. Prototyping != Produc:on-‐ready
2. We need Elas:city
4. Mul:-‐model architectures
3. Too many nice-‐to-‐have features
5. Avoid lack of ownership
AWS @ Romeclda.co/aws-‐roma
23. Machine Learning as a Service (MLaaS)
Amazon
Machine Learning
Azure
Machine Learning
Google
PredicCon API
IMB
Watson AnalyCcs
BigML
AWS @ Romeclda.co/aws-‐roma
cloudacademy.com/blog/machine-‐learning
24. Amazon Machine Learning
AmazonML
One of the first MLaaS solu:ons (Apr 2015)
It’s great for classifica:on and regression problems
Only linear models (linear & logis:c regression + SGD)
No support for advanced scenarios yet
AWS @ Romeclda.co/aws-‐roma
25. AmazonML @ Cloud Academy
clda.co/7-‐day-‐free
(no credit card required!)
AWS @ Romeclda.co/aws-‐roma
26. Serverless compuCng to the rescue!
Transparent scalability, elas:city and availability
Developer-‐friendly maintenance (versioning + aliases)
AWS
Lambda
Event-‐driven approach & never pay for idle
Microservices culture
AWS @ Romeclda.co/aws-‐roma
28. AWS @ Rome
Serverless ML @ Cloud Academy
Mul:-‐model architecture
RESTful interface for each ML model
1 Lambda Func:on for each ML model
S3 + RDS for storage
Periodic training (offline)
Real-‐world Example
clda.co/aws-‐roma
31. AWS @ Romeclda.co/aws-‐roma
AWS
Lambda
No real-‐:me models (only pseudo real-‐:me)
Deployment package management: size limit and OS libraries
Not suitable for model training yet (5 min max execu:on :me)
Cold start :me is long and hard to avoid
Unit/integra:on tests help, but not enough
LimitaCons of Serverless ML