SlideShare a Scribd company logo
Learn Like a Human: Taking Machine
Learning from Batch to Real-Time
By Elad Rosenheim, Senior Software Architect
delivered in
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
• The Industry’s Problem
• Old School Solutions
• Meet the Contextual Bandits
On the Agenda:
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
• Publishers, retailers, SaaS
all share a common problem
• They know their domain
but not how to optimize for each user
• Screen real-estate is limited
yet everyone sees the same thing
The Industry’s Problem
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
Commonly asked questions
• What articles should be
shown on the homepage of
an online publisher?
• What titles and images
would attract the most
clicks?
• What should the order and
layout of the articles be?
• Should every user see the
“Top Videos” section?
• What is the best layout for
the homepage?
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
Commonly asked questions
• Which product sorting
layout would yield the
highest revenue?
• Should the layout differ
significantly between
different user segments?
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
• What types of products should be shown,
and to whom?
Commonly asked questions
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
In the Beginning:
• First came the educated guess
• Then came the A/B test
• "Data Beats Opinion“
• Freedom to experiment (with nice tools)
• Hopefully: Less fear of change, less politics
• How does it work?
• Split traffic between baseline and alternative variations
• In theory: Sit and wait for significant results
• In practice: Peek at the numbers ‘til “95% confidence” is reached
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
While you wait, you're bleeding clicks!
Clicks = Money
What about the really dynamic stuff?
Campaigns, headlines, products on sale
A/B Tests: Already Old School?
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
• A Single-arm Bandit
• Suppose I have multiple arms in front of me,
each with its unknown mean reward…
• How do I optimize income from multiple
machines?
• Caution or Haste?
• Explore vs. Exploit
• In our context:
How do I optimize multiple variations?
Enter the Multi-arm Bandits
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
• (Very) Simple Solutions
• ε-greedy, ε–decreasing
• First 100% random explore, then ~90% exploit?
• Magic numbers, built-in revenue loss
• Bayesian-based approaches
• Smoother curve from explore to exploit
• “Winner” is now a less relevant term
Bandits - A Classic Problem
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
We want to find the variation “best on average“
…but we’re not improving the conversion rate of any single variation
Bandits work well when…
0.4%1.7%2.4%
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
• Each of us is a beautiful and unique feature vector!
• By showing the right variation to the right people, we can improve
conversions per variation and beat the best variation
• Machine learning challenge accepted!
Enter Personalization
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
The Usual Suspects
• Collaborative Filtering?
• Very big, very sparse matrix
• Cold start, batch process
• Not suitable in this case
• Classifiers?
• Logistic Regression, Random Forest et al.
• Periodically learn over all converters so far
• More data = more time, bigger model
• “Partial Feedback” problem:
• Users aren’t of class “Variation A” or “Variation B”.
• Rather, for any given user, we’re placing our bets on a variation and
don’t know what the reward would be for any other alternative.
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
• Like a bandit, we need to learn as we go (not in batch),
but this time with “context” - the user’s data
• Incremental Learning over the stream of impressions & rewards
(“Partial Fit”)
• We’re looking to…
• Start learning from the first impression
• Handle the explore-exploit curve
• Run fast (enough)
• Worst case: Converge on the best variation like a bandit
What We Need
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
• They “eat” the data stream
• They demand fast access to user data
• Historical or immediate
• Their model is always ready for action
• In the Papers
• Linear Bayes, LinUCB
• What we do: Per-Variation Logistic Regression
• A variant supporting updates in “mini-batches”
• Exploration-on-top
• Worst case: “Garbage In Multi Arm Bandit Out”
• Light on memory, compact output
Meet the Contextual Bandits
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
• Online should be fast & scaled
• Offline: A test-bed for iteratively testing new ideas
• New algorithms
• Tweaked parameters
• Feature transformations - last but not least!
How We Do It: Online & Offline
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
Persist Model
The Online Flow
DY Web Servers:
a. Get our script
b. Log impressions,
conversions
Learn Workers
User DB
Load to Predict Server
Queue Per Test
A B C
A B C
A B C
Predictions
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
• Test, Improve, Iterate
• Using real-world data
• Using generated data
• From easy to hard
The Offline Evaluator
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
• Learn in the center site, predict quickly in each geo. How?
• Push models via local Redis slaves
• Compressed SSH tunnel
• User data - daily aggregation
• Store into LMDB (simple, fast memory-mapped K/V DB)
• Sync via S3 (LZ4 compressed), read from local SSD
• Learn & Predict services
• Python as ML lingua franca: NumPy, SciPy, scikit-learn
Going Global
Learn Like a Human: Taking Machine Learning from Batch to Real-Time
• Better data beats better algorithms
• Reduce aggressively
Keep It Simple, Smart!
By Elad Rosenheim, Senior Software Architect
Final Word:
* Thanks to Idan Michaeli, Lead Data Scientist

More Related Content

PDF
How to Deliver Powerful Personalized Experiences
PPTX
Real-time Optimization and E-Commerce Personalization
PDF
Improving Revenue through Dynamic Product Recommendations
PPT
Quit Losing Money on Your Blog
PDF
Cross-Border Affiliate Marketing in China
PPTX
Product Optimization: Conversion, Engagement, and Happiness
PPTX
Beyond Page Views: Modern Analytics for Online Marketing
PPTX
Deep Dive 3: Advanced personalization: The secret weapon of ecommerce strateg...
How to Deliver Powerful Personalized Experiences
Real-time Optimization and E-Commerce Personalization
Improving Revenue through Dynamic Product Recommendations
Quit Losing Money on Your Blog
Cross-Border Affiliate Marketing in China
Product Optimization: Conversion, Engagement, and Happiness
Beyond Page Views: Modern Analytics for Online Marketing
Deep Dive 3: Advanced personalization: The secret weapon of ecommerce strateg...

What's hot (20)

PDF
Improving website conversions
PPTX
Geary LSF University Presents: Analytics Basics
PDF
Building a successful Multi-Screen Digital Strategy
PPT
Jessops - eCommerce Strategy
PPTX
Marketing Consulting Services
PDF
2014 ieef-optimization-meetup-october-2014
PDF
Establishing An Online Presence - Coonamble Shire Council
PDF
III Kongres eHandlu: Yash Abhishek Chaurasia (Unbounce.com), "Delightful Cust...
PPTX
SEO Is Dead?
PDF
Oren Cohen - Optimizely (All Things Data 2015)
PPTX
Google Premier Connect - Growing Health Businesses
PPT
IIA Analytics
PDF
Empowering Multiscreen web and mobile applications with Mobilespear
PPTX
Demandbase + Reachdesk: Turning Marketing Data into Magic
PDF
Klikki innometrics webinar presentation
PDF
From Unknown to Known: Turning Website Visitors into Organization Advocates
PDF
Introduction to Intempt
PPTX
Website evaluation
PPTX
Search Marketing In Airlines
Improving website conversions
Geary LSF University Presents: Analytics Basics
Building a successful Multi-Screen Digital Strategy
Jessops - eCommerce Strategy
Marketing Consulting Services
2014 ieef-optimization-meetup-october-2014
Establishing An Online Presence - Coonamble Shire Council
III Kongres eHandlu: Yash Abhishek Chaurasia (Unbounce.com), "Delightful Cust...
SEO Is Dead?
Oren Cohen - Optimizely (All Things Data 2015)
Google Premier Connect - Growing Health Businesses
IIA Analytics
Empowering Multiscreen web and mobile applications with Mobilespear
Demandbase + Reachdesk: Turning Marketing Data into Magic
Klikki innometrics webinar presentation
From Unknown to Known: Turning Website Visitors into Organization Advocates
Introduction to Intempt
Website evaluation
Search Marketing In Airlines
Ad

Similar to Learn Like a Human: Taking Machine Learning from Batch to Real-Time (20)

PPTX
Taking Machine Learning from Batch to Real-Time (big data eXposed 2015)
PDF
Thomas Jensen. Machine Learning
PDF
Building a Recommendation Engine - A Balancing act
PDF
From Labelling Open data images to building a private recommender system
PDF
EIA2017Italy - Danny Lange - Artificial Intelligence - A Game Changer in App ...
PPTX
Master Technical Recruiting Workshop: How to Recruit Top Tech Talent
PDF
Churn prediction data modeling
PPTX
An Agile Approach to Machine Learning
PDF
Solopreneuring Lessons Learned - Phoenix Startup Week
PPTX
An Overview of automated testing (1)
PPTX
Coaching teams in creative problem solving
PPTX
Building Startups and Minimum Viable Products (NDC2013)
PDF
H2O World - Solving Customer Churn with Machine Learning - Julian Bharadwaj
PPTX
Eric Proegler Oredev Performance Testing in New Contexts
PDF
BDX 2016 - Kevin lyons & yakir buskilla @ eXelate
PDF
CMS Crash Course!
PPTX
Moving Fast At Scale
PPTX
Big Data Spain 2018: How to build Weighted XGBoost ML model for Imbalance dat...
PPTX
Lecture13-Product-Development-PartI-Feb25-2018.pptx
PPT
Final spiralmodel97
Taking Machine Learning from Batch to Real-Time (big data eXposed 2015)
Thomas Jensen. Machine Learning
Building a Recommendation Engine - A Balancing act
From Labelling Open data images to building a private recommender system
EIA2017Italy - Danny Lange - Artificial Intelligence - A Game Changer in App ...
Master Technical Recruiting Workshop: How to Recruit Top Tech Talent
Churn prediction data modeling
An Agile Approach to Machine Learning
Solopreneuring Lessons Learned - Phoenix Startup Week
An Overview of automated testing (1)
Coaching teams in creative problem solving
Building Startups and Minimum Viable Products (NDC2013)
H2O World - Solving Customer Churn with Machine Learning - Julian Bharadwaj
Eric Proegler Oredev Performance Testing in New Contexts
BDX 2016 - Kevin lyons & yakir buskilla @ eXelate
CMS Crash Course!
Moving Fast At Scale
Big Data Spain 2018: How to build Weighted XGBoost ML model for Imbalance dat...
Lecture13-Product-Development-PartI-Feb25-2018.pptx
Final spiralmodel97
Ad

More from Dynamic Yield (10)

PPTX
Retailers fighting coronavirus with a cause
PDF
The Dynamic Yield Brand Bible
PDF
The State of Personalization Maturity: Q1 2018
PPTX
Personalizing the Tottenham Fan Experience
PDF
The Economics of eCommerce Conversion Rate Optimization
PDF
Understanding Product Recommendations: Value, Functionality & Best Practices
PDF
50 Million Shoppers Prove Power of Product Recommendations
PDF
Drinking Our Own Brew on DynamicYield.com
PDF
Proven Personalization Wins
 to Increase eCommerce Revenue
PDF
Landing page checklist
Retailers fighting coronavirus with a cause
The Dynamic Yield Brand Bible
The State of Personalization Maturity: Q1 2018
Personalizing the Tottenham Fan Experience
The Economics of eCommerce Conversion Rate Optimization
Understanding Product Recommendations: Value, Functionality & Best Practices
50 Million Shoppers Prove Power of Product Recommendations
Drinking Our Own Brew on DynamicYield.com
Proven Personalization Wins
 to Increase eCommerce Revenue
Landing page checklist

Recently uploaded (20)

PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
A Presentation on Artificial Intelligence
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Electronic commerce courselecture one. Pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
KodekX | Application Modernization Development
PPTX
Cloud computing and distributed systems.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
Machine learning based COVID-19 study performance prediction
NewMind AI Weekly Chronicles - August'25 Week I
A Presentation on Artificial Intelligence
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Electronic commerce courselecture one. Pdf
Digital-Transformation-Roadmap-for-Companies.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Unlocking AI with Model Context Protocol (MCP)
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KodekX | Application Modernization Development
Cloud computing and distributed systems.
Reach Out and Touch Someone: Haptics and Empathic Computing
“AI and Expert System Decision Support & Business Intelligence Systems”
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Encapsulation_ Review paper, used for researhc scholars
NewMind AI Monthly Chronicles - July 2025
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Dropbox Q2 2025 Financial Results & Investor Presentation

Learn Like a Human: Taking Machine Learning from Batch to Real-Time

  • 1. Learn Like a Human: Taking Machine Learning from Batch to Real-Time By Elad Rosenheim, Senior Software Architect delivered in
  • 2. Learn Like a Human: Taking Machine Learning from Batch to Real-Time • The Industry’s Problem • Old School Solutions • Meet the Contextual Bandits On the Agenda:
  • 3. Learn Like a Human: Taking Machine Learning from Batch to Real-Time • Publishers, retailers, SaaS all share a common problem • They know their domain but not how to optimize for each user • Screen real-estate is limited yet everyone sees the same thing The Industry’s Problem
  • 4. Learn Like a Human: Taking Machine Learning from Batch to Real-Time Commonly asked questions • What articles should be shown on the homepage of an online publisher? • What titles and images would attract the most clicks? • What should the order and layout of the articles be? • Should every user see the “Top Videos” section? • What is the best layout for the homepage?
  • 5. Learn Like a Human: Taking Machine Learning from Batch to Real-Time Commonly asked questions • Which product sorting layout would yield the highest revenue? • Should the layout differ significantly between different user segments?
  • 6. Learn Like a Human: Taking Machine Learning from Batch to Real-Time • What types of products should be shown, and to whom? Commonly asked questions
  • 7. Learn Like a Human: Taking Machine Learning from Batch to Real-Time In the Beginning: • First came the educated guess • Then came the A/B test • "Data Beats Opinion“ • Freedom to experiment (with nice tools) • Hopefully: Less fear of change, less politics • How does it work? • Split traffic between baseline and alternative variations • In theory: Sit and wait for significant results • In practice: Peek at the numbers ‘til “95% confidence” is reached
  • 8. Learn Like a Human: Taking Machine Learning from Batch to Real-Time While you wait, you're bleeding clicks! Clicks = Money What about the really dynamic stuff? Campaigns, headlines, products on sale A/B Tests: Already Old School?
  • 9. Learn Like a Human: Taking Machine Learning from Batch to Real-Time • A Single-arm Bandit • Suppose I have multiple arms in front of me, each with its unknown mean reward… • How do I optimize income from multiple machines? • Caution or Haste? • Explore vs. Exploit • In our context: How do I optimize multiple variations? Enter the Multi-arm Bandits
  • 10. Learn Like a Human: Taking Machine Learning from Batch to Real-Time • (Very) Simple Solutions • ε-greedy, ε–decreasing • First 100% random explore, then ~90% exploit? • Magic numbers, built-in revenue loss • Bayesian-based approaches • Smoother curve from explore to exploit • “Winner” is now a less relevant term Bandits - A Classic Problem
  • 11. Learn Like a Human: Taking Machine Learning from Batch to Real-Time We want to find the variation “best on average“ …but we’re not improving the conversion rate of any single variation Bandits work well when… 0.4%1.7%2.4%
  • 12. Learn Like a Human: Taking Machine Learning from Batch to Real-Time • Each of us is a beautiful and unique feature vector! • By showing the right variation to the right people, we can improve conversions per variation and beat the best variation • Machine learning challenge accepted! Enter Personalization
  • 13. Learn Like a Human: Taking Machine Learning from Batch to Real-Time The Usual Suspects • Collaborative Filtering? • Very big, very sparse matrix • Cold start, batch process • Not suitable in this case • Classifiers? • Logistic Regression, Random Forest et al. • Periodically learn over all converters so far • More data = more time, bigger model • “Partial Feedback” problem: • Users aren’t of class “Variation A” or “Variation B”. • Rather, for any given user, we’re placing our bets on a variation and don’t know what the reward would be for any other alternative.
  • 14. Learn Like a Human: Taking Machine Learning from Batch to Real-Time • Like a bandit, we need to learn as we go (not in batch), but this time with “context” - the user’s data • Incremental Learning over the stream of impressions & rewards (“Partial Fit”) • We’re looking to… • Start learning from the first impression • Handle the explore-exploit curve • Run fast (enough) • Worst case: Converge on the best variation like a bandit What We Need
  • 15. Learn Like a Human: Taking Machine Learning from Batch to Real-Time • They “eat” the data stream • They demand fast access to user data • Historical or immediate • Their model is always ready for action • In the Papers • Linear Bayes, LinUCB • What we do: Per-Variation Logistic Regression • A variant supporting updates in “mini-batches” • Exploration-on-top • Worst case: “Garbage In Multi Arm Bandit Out” • Light on memory, compact output Meet the Contextual Bandits
  • 16. Learn Like a Human: Taking Machine Learning from Batch to Real-Time • Online should be fast & scaled • Offline: A test-bed for iteratively testing new ideas • New algorithms • Tweaked parameters • Feature transformations - last but not least! How We Do It: Online & Offline
  • 17. Learn Like a Human: Taking Machine Learning from Batch to Real-Time Persist Model The Online Flow DY Web Servers: a. Get our script b. Log impressions, conversions Learn Workers User DB Load to Predict Server Queue Per Test A B C A B C A B C Predictions
  • 18. Learn Like a Human: Taking Machine Learning from Batch to Real-Time • Test, Improve, Iterate • Using real-world data • Using generated data • From easy to hard The Offline Evaluator
  • 19. Learn Like a Human: Taking Machine Learning from Batch to Real-Time • Learn in the center site, predict quickly in each geo. How? • Push models via local Redis slaves • Compressed SSH tunnel • User data - daily aggregation • Store into LMDB (simple, fast memory-mapped K/V DB) • Sync via S3 (LZ4 compressed), read from local SSD • Learn & Predict services • Python as ML lingua franca: NumPy, SciPy, scikit-learn Going Global
  • 20. Learn Like a Human: Taking Machine Learning from Batch to Real-Time • Better data beats better algorithms • Reduce aggressively Keep It Simple, Smart! By Elad Rosenheim, Senior Software Architect Final Word: * Thanks to Idan Michaeli, Lead Data Scientist

Editor's Notes

  • #4: איך ניסו עד היום לתקוף את הבעיות האלה?
  • #5: בואו ניקח את הפיתרון שלנו שלב אחד קדימה
  • #6: בואו ניקח את הפיתרון שלנו שלב אחד קדימה
  • #7: בואו ניקח את הפיתרון שלנו שלב אחד קדימה
  • #8: בקיצור, העולם לא כ"כ מופלא כפי שמוכרים לנו
  • #9: בואו ניקח את הפיתרון שלנו שלב אחד קדימה
  • #10: לבעיה הזו אין פיתרון אופטימלי, אבל יש בהחלט גישות שונות ברמות שונות של מורכבות
  • #11: עכשיו, בנדיטים הם לא כ"כ רעים למעשה...
  • #12: והמגבלה הזו מביאה אותנו לשלב הבא בחיפוש, והוא: פרסונליזציה
  • #13: יפה, אז קיבלנו את האתגר. על איזה אלגוריתמים אנחנו חושבים?
  • #14: אז בעצם, אנחנו מחפשים משהו אחר – משפחה חדשה של אלגוריתמים
  • #15: אז בואו ונכיר את הגיבורים החדשים שלנו...
  • #16: אלגוריתם כשלעצמו זה דבר נחמד, אבל איך בונים את כל המעטפת לפרודקשן?
  • #17: בואו ונבין טוב יותר את הזרימה