SlideShare a Scribd company logo
© 2017 MapR Technologies 1
Machine Learning Model Management
© 2017 MapR Technologies 2
Contact Information
Ted Dunning, PhD
Chief Application Architect, MapR Technologies
Committer, PMC member, board member, ASF
O’Reilly author
Email tdunning@mapr.com tdunning@apache.org
Twitter @Ted_Dunning
© 2017 MapR Technologies 3
Machine Learning Everywhere
Image courtesy Mtell used with permission.Images © Ellen Friedman.
© 2017 MapR Technologies 4
Traditional View
© 2017 MapR Technologies 5
Traditional View: This isn’t the whole story
© 2017 MapR Technologies 6
90% of the effort in successful machine
learning isn’t in the training or model dev…
It’s the logistics
© 2017 MapR Technologies 7
Why?
• Just getting the training data is hard
– Which data? How to make it accessible? Multiple sources!
– New kinds of observations force restarts
– Requires a ton of domain knowledge
• The myth of the unitary model
– You can’t train just one
– You will have dozens of models, likely hundreds or more
– Handoff to new versions is tricky
– You have to get run-time to be sure about which is better

© 2017 MapR Technologies 8
What Machine Learning Tool is Best?
• Most successful groups keep several “favorite” machine
learning tools at hand
– No single tool is best in every situation
• The most important tool is a platform that supports logistics well
– Don’t have to do everything at the application level
– Lots of what matters can be handled at the platform level
• A good design for the logistics can make a big difference
© 2017 MapR Technologies 9
Some Gotchas
• Ops-oriented people will not “get it” regarding modeling
subtleties
• Data scientists will not “get it” regarding operational realities
• Therefore, modelers have to deliver self-contained models
• And, ops has to provide pre-wired structure
© 2017 MapR Technologies 10
Rendezvous Architecture
Input Scores
RendezvousModel 1
Model 2
Model 3
request
response
Results
© 2017 MapR Technologies 11
Rendezvous to the Rescue: Better ML Logistics
• Stream-1st architecture is a powerful approach with surprisingly
widespread advantages
– Innovative technologies emerging to for streaming data
• Microservices approach provides flexibility
– Streaming supports microservices (if done right)
• Containers remove surprises
– Predictable environment for running models
© 2017 MapR Technologies 12
Rendezvous: Mainly for Decisioning Engines
• Decisioning models
– Looking for a “right answer”
– Simpler than reinforcement learning
• Examples include:
– Fraud detection
– Predictive analytics / market prediction
– Churn prediction (as in telecommunications)
– Yield optimization
– Deep learning in form of speech or image recognition, in some cases
© 2017 MapR Technologies 13
Why Stream?
Munich surfing wave Image © 2017 Ellen Friedman
© 2017 MapR Technologies 14
Stream-1st Architecture: Basis for MicroServices
Stream instead of database as the shared “truth”
POS
1..n
Fraud
detector
Last card
use
Updater
Card
analytics
Other
card activity
Image © 2016 Ted Dunning & Ellen Friedman from Chap 6 of O’Reilly book Streaming Architecture used with permission
© 2017 MapR Technologies 15
Streaming Isolates Services
stream
Data
source
Consumer
© 2017 MapR Technologies 16
With MapR, Geo-Distributed Data Appears Local
stream
stream
Data
source
Consumer
© 2017 MapR Technologies 17
With MapR, Geo-distributed Data Appears Local
stream
stream
Data
source
ConsumerGlobal Data Center
Regional Data Center
© 2017 MapR Technologies 18
Features of Good Streaming
• It is Persistent
– Messages stick around for other consumers
– Consumers don’t affect producers
– Consumer doesn’t have to be online when message arrives
• It is Performant
– You don’t have to worry if a stream can keep up
• It is Pervasive
– It is there whenever you need it, no need to deploy anything
– How much work is it to create a new file? Why harder for a stream?
© 2017 MapR Technologies 19
Stream transport supports
microservices
© 2017 MapR Technologies 20
But we talked about decision
engines?!?
© 2017 MapR Technologies 21
What We Ultimately Want
request
response
Model
© 2017 MapR Technologies 22
But This Isn’t The Answer
Model 1
request
response
Load
balancer
Model 2
Model 3
© 2017 MapR Technologies 23
First Try with Streams
Input
Model 1
Model 2
Model 3
request
response
?
© 2017 MapR Technologies 24
First Rendezvous
Input Scores
RendezvousModel 1
Model 2
Model 3
request
response
Results
© 2017 MapR Technologies 25
Some Key Points
• Note that all models see identical inputs
• All models run in production setting
• All models send scores to same stream
• The rendezvous server decides which scores to ignore
• Roll forward, roll back, correlated comparison are all now trivial
© 2017 MapR Technologies 26
Reality Check, Injecting External State
Model 1
Model 2
Model 3
request
Raw
Add
external
data
Input
Database
The world
© 2017 MapR Technologies 27
Recording Raw Data (as it really was)
Input
Scores
Decoy
Model 2
Model 3
Archive
© 2017 MapR Technologies 28
Quality & Reproducibility of Input Data is Important!
• Recording raw-ish data is really a big deal
– Data as seen by a model is worth gold
– Data reconstructed later often has time-machine leaks
– Databases were made for updates, streams are safer
• Raw data is useful for non-ML cases as well (think flexibility)
• Decoy model records training data as seen by models under
development & evaluation
© 2017 MapR Technologies 29
Canary for Comparison
Real
model
∆
Result
Canary
Decoy
Archive
Input
© 2017 MapR Technologies 30
What Does the Canary Do?
• The canary is a real model, but is very rarely updated
• The canary results are almost never used for decisioning
• The virtue of the canary is stability
• Comparing to the canary results gives insight into new models
© 2017 MapR Technologies 31
Isolated Development With Stream Replication
Model 1
Model 2
Model 3
request
Raw
Add
external
data
Input
Internal 1
Internal 2
Internal 3
The world
Model 4
Raw
New
external
data
Input
Internal 4
Production
Development
© 2017 MapR Technologies 32
Scores
ArchiveDecoy
m1
m2
m3
Features /
profiles
InputRaw
© 2017 MapR Technologies 33
ResultsRendezvousScores
ArchiveDecoy
m1
m2
m3
Features /
profiles
InputRaw
© 2017 MapR Technologies 34
Metrics
Metrics
ResultsRendezvousScores
ArchiveDecoy
m1
m2
m3
Features /
profiles
InputRaw
© 2017 MapR Technologies 35
Models in production live in the real
world:
Conditions may (will) change
© 2017 MapR Technologies 36
Not Such Bad Ideas
• Keep models running “in the wings”
– Don’t wait until conditions change to start building the next model
– Keep new short-history models ready to roll, some graybeards as well
• Hot hand-off
– With rendezvous: just stop ignoring the new best model
• Deploy a canary server
– Keep an old model active as a reference
– If it was 90% correct, difference with any better model should be small
– Score distribution should be roughly constant
© 2017 MapR Technologies 37
Correlated Comparison of Score Quantiles
© 2017 MapR Technologies 38
Sample Model Cascade
A
B
Fraud
Fraud
Clean
Clean
Fraud
Assume that finding more frauds is all we care to do
© 2017 MapR Technologies 39
Some Data
© 2017 MapR Technologies 40
Consisting of Type 1
© 2017 MapR Technologies 41
And Type 2
© 2017 MapR Technologies 42
Sample Model Cascade
A
B
Fraud
Fraud
Clean
Clean
Fraud
Good with type 1
Good with type 2
© 2017 MapR Technologies 43
Baseline Conditions
• Model A
– 80% recall on type 1, 0% recall on type 2 (40% net)
• Model B
– 0% recall on type 1, 80% recall on type 2 (40% net)
• Combined
– No overlap in responses
– 80% recall on type 1 (due to model A)
– 80% recall on type 2 (due to model B)
– 80% recall overall
© 2017 MapR Technologies 44
“New and Improved”
• Suppose model A is “improved”
– Before: 80% recall on type 1, 0% recall on type 2 (40% net)
– After: 40% recall on type 1, 100% also on type 2 (70% net)
• Combined after change
– Huge overlap in responses
– 40% recall on type 1 (due to model A)
– 100% recall on type 2 (due to model A)
– Model B has no effect
– 70% recall overall
© 2017 MapR Technologies 45
Coupling Paradox
© 2017 MapR Technologies 46
Is There Any Hope?
• This kind of problem is HARD
– Do your competitor’s and your own marketing model couple?
• Where possible, use ensembles instead of cascades
– Not as simple as it sounds
• Where possible, deploy composite models as units
– Not as simple as it sounds
• Always measure everything!
© 2017 MapR Technologies 47
How to Do Better
• Data + the right question + domain knowledge matter!
• Prioritize – put serious effort into infrastructure
– DataOps requires more than just data science
• Persist – use streams to keep data around
• Measure – everything, and record it
• Meta-analyze – understand and see what is happening
• Containerize – make deployment repeatable, easy
• Oh… don’t forget to do some machine learning, too
© 2017 MapR Technologies 48
Additional Resources
O’Reilly report by Ted Dunning & Ellen Friedman © March 2017
Read free courtesy of MapR:
https://mapr.com/geo-distribution-big-data-and-analytics/
O’Reilly book by Ted Dunning & Ellen Friedman
© March 2016
Read free courtesy of MapR:
https://mapr.com/streaming-architecture-using-
apache-kafka-mapr-streams/
© 2017 MapR Technologies 49
Additional Resources
O’Reilly book by Ted Dunning & Ellen Friedman
© June 2014
Read free courtesy of MapR:
https://mapr.com/practical-machine-learning-
new-look-anomaly-detection/
O’Reilly book by Ellen Friedman & Ted Dunning
© February 2014
Read free courtesy of MapR:
https://mapr.com/practical-machine-learning/
© 2017 MapR Technologies 50
Additional Resources
by Ellen Friedman 8 Aug 2017 on MapR blog:
https://mapr.com/blog/tensorflow-mxnet-caffe-h2o-which-ml-best/
by Ted Dunning 13 Sept 2017 in
InfoWorld:
https://www.infoworld.com/article/3223
688/machine-learning/machine-
learning-skills-for-software-
engineers.html
© 2017 MapR Technologies 51
New book: Machine Learning Logistics
Model Management in the Real World
O’Reilly book by Ellen Friedman & Ted Dunning © Sept 2017
Pre-register for a free pdf copy of book when it becomes available 26th
September, courtesy of MapR
http://info.mapr.com/2017_Content_Machine-Learning-
Logistics_eBook_Prereg_RegistrationPage.html
Going to Strata Data NYC? Book will be released 26 Sept 2017:
Visit MapR booth for free book signings or to talk about logistics
© 2017 MapR Technologies 52
Please support women in tech – help build
girls’ dreams of what they can accomplish
© Ellen Friedman 2015#womenintech #datawomen
© 2017 MapR Technologies 53
Q&A
@mapr
tdunning@mapr.com
ENGAGE WITH US
@ Ted_Dunning

More Related Content

PPTX
Tensor Abuse - how to reuse machine learning frameworks
Ted Dunning
 
PPTX
Streaming Architecture including Rendezvous for Machine Learning
Ted Dunning
 
PPTX
T digest-update
Ted Dunning
 
PPTX
Machine Learning Logistics
Ted Dunning
 
PPTX
Finding Changes in Real Data
Ted Dunning
 
PDF
Surprising Advantages of Streaming - ACM March 2018
Ellen Friedman
 
PPTX
Machine Learning for Chickens, Autonomous Driving and a 3-year-old Who Won’t ...
MapR Technologies
 
PDF
Streaming Goes Mainstream: New Architecture & Emerging Technologies for Strea...
MapR Technologies
 
Tensor Abuse - how to reuse machine learning frameworks
Ted Dunning
 
Streaming Architecture including Rendezvous for Machine Learning
Ted Dunning
 
T digest-update
Ted Dunning
 
Machine Learning Logistics
Ted Dunning
 
Finding Changes in Real Data
Ted Dunning
 
Surprising Advantages of Streaming - ACM March 2018
Ellen Friedman
 
Machine Learning for Chickens, Autonomous Driving and a 3-year-old Who Won’t ...
MapR Technologies
 
Streaming Goes Mainstream: New Architecture & Emerging Technologies for Strea...
MapR Technologies
 

What's hot (20)

PPTX
Where is Data Going? - RMDC Keynote
Ted Dunning
 
PPTX
Cheap learning-dunning-9-18-2015
Ted Dunning
 
PPTX
Real time-hadoop
Ted Dunning
 
PPTX
Real-time Puppies and Ponies - Evolving Indicator Recommendations in Real-time
Ted Dunning
 
PPTX
Sharing Sensitive Data Securely
Ted Dunning
 
PPTX
How to tell which algorithms really matter
DataWorks Summit
 
PPTX
Cognitive computing with big data, high tech and low tech approaches
Ted Dunning
 
PPTX
What is the past future tense of data?
Ted Dunning
 
PPTX
Doing-the-impossible
Ted Dunning
 
PDF
Streaming patterns revolutionary architectures
Carol McDonald
 
PPTX
MapR and Machine Learning Primer
Mathieu Dumoulin
 
PPTX
Anomaly Detection - New York Machine Learning
Ted Dunning
 
PPTX
Dunning time-series-2015
Ted Dunning
 
PPTX
Which Algorithms Really Matter
Ted Dunning
 
PPTX
Hadoop and R Go to the Movies
DataWorks Summit
 
PPTX
Possible Visions for Mahout 1.0
Ted Dunning
 
PDF
Mathematical bridges From Old to New
MapR Technologies
 
PDF
How Big Data is Reducing Costs and Improving Outcomes in Health Care
Carol McDonald
 
PDF
Structured Streaming Data Pipeline Using Kafka, Spark, and MapR-DB
Carol McDonald
 
PPTX
What's new in Apache Mahout
Ted Dunning
 
Where is Data Going? - RMDC Keynote
Ted Dunning
 
Cheap learning-dunning-9-18-2015
Ted Dunning
 
Real time-hadoop
Ted Dunning
 
Real-time Puppies and Ponies - Evolving Indicator Recommendations in Real-time
Ted Dunning
 
Sharing Sensitive Data Securely
Ted Dunning
 
How to tell which algorithms really matter
DataWorks Summit
 
Cognitive computing with big data, high tech and low tech approaches
Ted Dunning
 
What is the past future tense of data?
Ted Dunning
 
Doing-the-impossible
Ted Dunning
 
Streaming patterns revolutionary architectures
Carol McDonald
 
MapR and Machine Learning Primer
Mathieu Dumoulin
 
Anomaly Detection - New York Machine Learning
Ted Dunning
 
Dunning time-series-2015
Ted Dunning
 
Which Algorithms Really Matter
Ted Dunning
 
Hadoop and R Go to the Movies
DataWorks Summit
 
Possible Visions for Mahout 1.0
Ted Dunning
 
Mathematical bridges From Old to New
MapR Technologies
 
How Big Data is Reducing Costs and Improving Outcomes in Health Care
Carol McDonald
 
Structured Streaming Data Pipeline Using Kafka, Spark, and MapR-DB
Carol McDonald
 
What's new in Apache Mahout
Ted Dunning
 
Ad

Similar to Machine Learning logistics (20)

PPTX
ML Workshop 1: A New Architecture for Machine Learning Logistics
MapR Technologies
 
PPTX
Machine Learning Success: The Key to Easier Model Management
MapR Technologies
 
PDF
Big Data LDN 2018: DATA OPERATIONS PROBLEMS CREATED BY DEEP LEARNING, AND HOW...
Matt Stubbs
 
PPTX
ML Workshop 2: Machine Learning Model Comparison & Evaluation
MapR Technologies
 
PDF
DataOps: An Agile Method for Data-Driven Organizations
Ellen Friedman
 
PPTX
Designing data pipelines for analytics and machine learning in industrial set...
DataWorks Summit
 
PPTX
Operationalizing Machine Learning
AgileThought
 
PDF
MapR & Skytree:
MapR Technologies
 
PDF
Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...
Carol McDonald
 
PDF
Operationalizing Machine Learning at Scale with Sameer Nori
Databricks
 
PDF
Spark and MapR Streams: A Motivating Example
Ian Downard
 
PPTX
Deep Learning vs. Cheap Learning
MapR Technologies
 
PDF
Predictive Maintenance Using Recurrent Neural Networks
Justin Brandenburg
 
PDF
Live Tutorial – Streaming Real-Time Events Using Apache APIs
MapR Technologies
 
PPTX
Self-Service Data Science for Leveraging ML & AI on All of Your Data
MapR Technologies
 
PDF
Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...
Carol McDonald
 
PDF
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real- T...
Carol McDonald
 
PDF
Free Code Friday - Machine Learning with Apache Spark
MapR Technologies
 
PDF
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...
Carol McDonald
 
PDF
Anomaly Detection in Telecom with Spark - Tugdual Grall - Codemotion Amsterda...
Codemotion
 
ML Workshop 1: A New Architecture for Machine Learning Logistics
MapR Technologies
 
Machine Learning Success: The Key to Easier Model Management
MapR Technologies
 
Big Data LDN 2018: DATA OPERATIONS PROBLEMS CREATED BY DEEP LEARNING, AND HOW...
Matt Stubbs
 
ML Workshop 2: Machine Learning Model Comparison & Evaluation
MapR Technologies
 
DataOps: An Agile Method for Data-Driven Organizations
Ellen Friedman
 
Designing data pipelines for analytics and machine learning in industrial set...
DataWorks Summit
 
Operationalizing Machine Learning
AgileThought
 
MapR & Skytree:
MapR Technologies
 
Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...
Carol McDonald
 
Operationalizing Machine Learning at Scale with Sameer Nori
Databricks
 
Spark and MapR Streams: A Motivating Example
Ian Downard
 
Deep Learning vs. Cheap Learning
MapR Technologies
 
Predictive Maintenance Using Recurrent Neural Networks
Justin Brandenburg
 
Live Tutorial – Streaming Real-Time Events Using Apache APIs
MapR Technologies
 
Self-Service Data Science for Leveraging ML & AI on All of Your Data
MapR Technologies
 
Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...
Carol McDonald
 
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real- T...
Carol McDonald
 
Free Code Friday - Machine Learning with Apache Spark
MapR Technologies
 
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...
Carol McDonald
 
Anomaly Detection in Telecom with Spark - Tugdual Grall - Codemotion Amsterda...
Codemotion
 
Ad

More from Ted Dunning (12)

PPTX
Dunning - SIGMOD - Data Economy.pptx
Ted Dunning
 
PPTX
How to Get Going with Kubernetes
Ted Dunning
 
PPTX
Progress for big data in Kubernetes
Ted Dunning
 
PPTX
Anomaly Detection: How to find what you didn’t know to look for
Ted Dunning
 
PPTX
How the Internet of Things is Turning the Internet Upside Down
Ted Dunning
 
PPTX
Apache Kylin - OLAP Cubes for SQL on Hadoop
Ted Dunning
 
PPTX
Recommendation Techn
Ted Dunning
 
PPTX
My talk about recommendation and search to the Hive
Ted Dunning
 
PDF
Strata 2014 Anomaly Detection
Ted Dunning
 
PPTX
Building multi-modal recommendation engines using search engines
Ted Dunning
 
PPTX
Using Mahout and a Search Engine for Recommendation
Ted Dunning
 
PPTX
Inside MapR's M7
Ted Dunning
 
Dunning - SIGMOD - Data Economy.pptx
Ted Dunning
 
How to Get Going with Kubernetes
Ted Dunning
 
Progress for big data in Kubernetes
Ted Dunning
 
Anomaly Detection: How to find what you didn’t know to look for
Ted Dunning
 
How the Internet of Things is Turning the Internet Upside Down
Ted Dunning
 
Apache Kylin - OLAP Cubes for SQL on Hadoop
Ted Dunning
 
Recommendation Techn
Ted Dunning
 
My talk about recommendation and search to the Hive
Ted Dunning
 
Strata 2014 Anomaly Detection
Ted Dunning
 
Building multi-modal recommendation engines using search engines
Ted Dunning
 
Using Mahout and a Search Engine for Recommendation
Ted Dunning
 
Inside MapR's M7
Ted Dunning
 

Recently uploaded (20)

PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 

Machine Learning logistics

  • 1. © 2017 MapR Technologies 1 Machine Learning Model Management
  • 2. © 2017 MapR Technologies 2 Contact Information Ted Dunning, PhD Chief Application Architect, MapR Technologies Committer, PMC member, board member, ASF O’Reilly author Email [email protected] [email protected] Twitter @Ted_Dunning
  • 3. © 2017 MapR Technologies 3 Machine Learning Everywhere Image courtesy Mtell used with permission.Images © Ellen Friedman.
  • 4. © 2017 MapR Technologies 4 Traditional View
  • 5. © 2017 MapR Technologies 5 Traditional View: This isn’t the whole story
  • 6. © 2017 MapR Technologies 6 90% of the effort in successful machine learning isn’t in the training or model dev… It’s the logistics
  • 7. © 2017 MapR Technologies 7 Why? • Just getting the training data is hard – Which data? How to make it accessible? Multiple sources! – New kinds of observations force restarts – Requires a ton of domain knowledge • The myth of the unitary model – You can’t train just one – You will have dozens of models, likely hundreds or more – Handoff to new versions is tricky – You have to get run-time to be sure about which is better 
  • 8. © 2017 MapR Technologies 8 What Machine Learning Tool is Best? • Most successful groups keep several “favorite” machine learning tools at hand – No single tool is best in every situation • The most important tool is a platform that supports logistics well – Don’t have to do everything at the application level – Lots of what matters can be handled at the platform level • A good design for the logistics can make a big difference
  • 9. © 2017 MapR Technologies 9 Some Gotchas • Ops-oriented people will not “get it” regarding modeling subtleties • Data scientists will not “get it” regarding operational realities • Therefore, modelers have to deliver self-contained models • And, ops has to provide pre-wired structure
  • 10. © 2017 MapR Technologies 10 Rendezvous Architecture Input Scores RendezvousModel 1 Model 2 Model 3 request response Results
  • 11. © 2017 MapR Technologies 11 Rendezvous to the Rescue: Better ML Logistics • Stream-1st architecture is a powerful approach with surprisingly widespread advantages – Innovative technologies emerging to for streaming data • Microservices approach provides flexibility – Streaming supports microservices (if done right) • Containers remove surprises – Predictable environment for running models
  • 12. © 2017 MapR Technologies 12 Rendezvous: Mainly for Decisioning Engines • Decisioning models – Looking for a “right answer” – Simpler than reinforcement learning • Examples include: – Fraud detection – Predictive analytics / market prediction – Churn prediction (as in telecommunications) – Yield optimization – Deep learning in form of speech or image recognition, in some cases
  • 13. © 2017 MapR Technologies 13 Why Stream? Munich surfing wave Image © 2017 Ellen Friedman
  • 14. © 2017 MapR Technologies 14 Stream-1st Architecture: Basis for MicroServices Stream instead of database as the shared “truth” POS 1..n Fraud detector Last card use Updater Card analytics Other card activity Image © 2016 Ted Dunning & Ellen Friedman from Chap 6 of O’Reilly book Streaming Architecture used with permission
  • 15. © 2017 MapR Technologies 15 Streaming Isolates Services stream Data source Consumer
  • 16. © 2017 MapR Technologies 16 With MapR, Geo-Distributed Data Appears Local stream stream Data source Consumer
  • 17. © 2017 MapR Technologies 17 With MapR, Geo-distributed Data Appears Local stream stream Data source ConsumerGlobal Data Center Regional Data Center
  • 18. © 2017 MapR Technologies 18 Features of Good Streaming • It is Persistent – Messages stick around for other consumers – Consumers don’t affect producers – Consumer doesn’t have to be online when message arrives • It is Performant – You don’t have to worry if a stream can keep up • It is Pervasive – It is there whenever you need it, no need to deploy anything – How much work is it to create a new file? Why harder for a stream?
  • 19. © 2017 MapR Technologies 19 Stream transport supports microservices
  • 20. © 2017 MapR Technologies 20 But we talked about decision engines?!?
  • 21. © 2017 MapR Technologies 21 What We Ultimately Want request response Model
  • 22. © 2017 MapR Technologies 22 But This Isn’t The Answer Model 1 request response Load balancer Model 2 Model 3
  • 23. © 2017 MapR Technologies 23 First Try with Streams Input Model 1 Model 2 Model 3 request response ?
  • 24. © 2017 MapR Technologies 24 First Rendezvous Input Scores RendezvousModel 1 Model 2 Model 3 request response Results
  • 25. © 2017 MapR Technologies 25 Some Key Points • Note that all models see identical inputs • All models run in production setting • All models send scores to same stream • The rendezvous server decides which scores to ignore • Roll forward, roll back, correlated comparison are all now trivial
  • 26. © 2017 MapR Technologies 26 Reality Check, Injecting External State Model 1 Model 2 Model 3 request Raw Add external data Input Database The world
  • 27. © 2017 MapR Technologies 27 Recording Raw Data (as it really was) Input Scores Decoy Model 2 Model 3 Archive
  • 28. © 2017 MapR Technologies 28 Quality & Reproducibility of Input Data is Important! • Recording raw-ish data is really a big deal – Data as seen by a model is worth gold – Data reconstructed later often has time-machine leaks – Databases were made for updates, streams are safer • Raw data is useful for non-ML cases as well (think flexibility) • Decoy model records training data as seen by models under development & evaluation
  • 29. © 2017 MapR Technologies 29 Canary for Comparison Real model ∆ Result Canary Decoy Archive Input
  • 30. © 2017 MapR Technologies 30 What Does the Canary Do? • The canary is a real model, but is very rarely updated • The canary results are almost never used for decisioning • The virtue of the canary is stability • Comparing to the canary results gives insight into new models
  • 31. © 2017 MapR Technologies 31 Isolated Development With Stream Replication Model 1 Model 2 Model 3 request Raw Add external data Input Internal 1 Internal 2 Internal 3 The world Model 4 Raw New external data Input Internal 4 Production Development
  • 32. © 2017 MapR Technologies 32 Scores ArchiveDecoy m1 m2 m3 Features / profiles InputRaw
  • 33. © 2017 MapR Technologies 33 ResultsRendezvousScores ArchiveDecoy m1 m2 m3 Features / profiles InputRaw
  • 34. © 2017 MapR Technologies 34 Metrics Metrics ResultsRendezvousScores ArchiveDecoy m1 m2 m3 Features / profiles InputRaw
  • 35. © 2017 MapR Technologies 35 Models in production live in the real world: Conditions may (will) change
  • 36. © 2017 MapR Technologies 36 Not Such Bad Ideas • Keep models running “in the wings” – Don’t wait until conditions change to start building the next model – Keep new short-history models ready to roll, some graybeards as well • Hot hand-off – With rendezvous: just stop ignoring the new best model • Deploy a canary server – Keep an old model active as a reference – If it was 90% correct, difference with any better model should be small – Score distribution should be roughly constant
  • 37. © 2017 MapR Technologies 37 Correlated Comparison of Score Quantiles
  • 38. © 2017 MapR Technologies 38 Sample Model Cascade A B Fraud Fraud Clean Clean Fraud Assume that finding more frauds is all we care to do
  • 39. © 2017 MapR Technologies 39 Some Data
  • 40. © 2017 MapR Technologies 40 Consisting of Type 1
  • 41. © 2017 MapR Technologies 41 And Type 2
  • 42. © 2017 MapR Technologies 42 Sample Model Cascade A B Fraud Fraud Clean Clean Fraud Good with type 1 Good with type 2
  • 43. © 2017 MapR Technologies 43 Baseline Conditions • Model A – 80% recall on type 1, 0% recall on type 2 (40% net) • Model B – 0% recall on type 1, 80% recall on type 2 (40% net) • Combined – No overlap in responses – 80% recall on type 1 (due to model A) – 80% recall on type 2 (due to model B) – 80% recall overall
  • 44. © 2017 MapR Technologies 44 “New and Improved” • Suppose model A is “improved” – Before: 80% recall on type 1, 0% recall on type 2 (40% net) – After: 40% recall on type 1, 100% also on type 2 (70% net) • Combined after change – Huge overlap in responses – 40% recall on type 1 (due to model A) – 100% recall on type 2 (due to model A) – Model B has no effect – 70% recall overall
  • 45. © 2017 MapR Technologies 45 Coupling Paradox
  • 46. © 2017 MapR Technologies 46 Is There Any Hope? • This kind of problem is HARD – Do your competitor’s and your own marketing model couple? • Where possible, use ensembles instead of cascades – Not as simple as it sounds • Where possible, deploy composite models as units – Not as simple as it sounds • Always measure everything!
  • 47. © 2017 MapR Technologies 47 How to Do Better • Data + the right question + domain knowledge matter! • Prioritize – put serious effort into infrastructure – DataOps requires more than just data science • Persist – use streams to keep data around • Measure – everything, and record it • Meta-analyze – understand and see what is happening • Containerize – make deployment repeatable, easy • Oh… don’t forget to do some machine learning, too
  • 48. © 2017 MapR Technologies 48 Additional Resources O’Reilly report by Ted Dunning & Ellen Friedman © March 2017 Read free courtesy of MapR: https://mapr.com/geo-distribution-big-data-and-analytics/ O’Reilly book by Ted Dunning & Ellen Friedman © March 2016 Read free courtesy of MapR: https://mapr.com/streaming-architecture-using- apache-kafka-mapr-streams/
  • 49. © 2017 MapR Technologies 49 Additional Resources O’Reilly book by Ted Dunning & Ellen Friedman © June 2014 Read free courtesy of MapR: https://mapr.com/practical-machine-learning- new-look-anomaly-detection/ O’Reilly book by Ellen Friedman & Ted Dunning © February 2014 Read free courtesy of MapR: https://mapr.com/practical-machine-learning/
  • 50. © 2017 MapR Technologies 50 Additional Resources by Ellen Friedman 8 Aug 2017 on MapR blog: https://mapr.com/blog/tensorflow-mxnet-caffe-h2o-which-ml-best/ by Ted Dunning 13 Sept 2017 in InfoWorld: https://www.infoworld.com/article/3223 688/machine-learning/machine- learning-skills-for-software- engineers.html
  • 51. © 2017 MapR Technologies 51 New book: Machine Learning Logistics Model Management in the Real World O’Reilly book by Ellen Friedman & Ted Dunning © Sept 2017 Pre-register for a free pdf copy of book when it becomes available 26th September, courtesy of MapR http://info.mapr.com/2017_Content_Machine-Learning- Logistics_eBook_Prereg_RegistrationPage.html Going to Strata Data NYC? Book will be released 26 Sept 2017: Visit MapR booth for free book signings or to talk about logistics
  • 52. © 2017 MapR Technologies 52 Please support women in tech – help build girls’ dreams of what they can accomplish © Ellen Friedman 2015#womenintech #datawomen
  • 53. © 2017 MapR Technologies 53 Q&A @mapr [email protected] ENGAGE WITH US @ Ted_Dunning