SlideShare a Scribd company logo
Technical debt in ML
by Jaroslaw Szymczak, Senior Data Scientist @ OLX Group
2
Agenda
● Introduction
● Basic concepts
● Components of technical debt in machine learning...
● … and how can we tackle them
● Q&A
3
Few words about OLX
350+ million
active users
40+
countries
60+ million new
listings per month
Market leader
in 35 countries
4
● M. Sc. in computer science with speciality in machine learning
● Senior Data Scientist @ OLX Group
● Focusing on content quality as well as trust and safety topics
● Responsible for full ML projects lifecycle - research,
productization, development and maintenance
● Having experience in delivering anti-fraud solutions for tier one
European insurance companies as well as retail and investment
banks
● Worked on external data science projects for churn prediction,
sales estimation and predictive maintenance for various
companies in Germany and Poland
And few words about me
jaroslaw.szymczak@olx.com
Basic concepts
What is technical debt? How this concept work with relation
to ML?
6
Technical debt
Technical debt is a concept in software development that reflects the implied cost of additional rework
caused by choosing an easy solution now instead of using a better approach that would take longer.
(by Wikipedia)
● Main components increasing technical debt:
○ lack of testing
○ inadequate system monitoring
○ code complexity
○ “dependency jungle”
○ lack of documentation (especially painful in connection with high staff turnover)
● Main reasons of technical debt:
○ time pressure
○ using prototypes as base for production system
○ lack of technical debt awareness
7
Technical debt in machine learning
Technical debt in machine learning is a usual technical debt plus more. ML has unique capability of
increasing the debt in extremely fast pace.
Image source: https://c.pxhere.com/photos/29/fb/money_euro_coin_coins_bank_note_calculator_budget_save-1021960.jpg!d (labelled for reuse)
Components of technical debt
in ML
Or at least some of them
9
(Hidden) feedback loops
Image source: https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/General_closed_loop_feedback_system.svg/400px-General_closed_loop_feedback_system.svg.png
When system is retrained on the data it has provided… and what’s worse - when you
measure performance on such data only...
10
Breaking the loop
Sampling Model retraining Testing & monitoring
There’s an area for footnotes too!
● should be seen as
a necessity, not as
optional feature
● make sure to make
it unbiased
● or take bias into
account
● cannot be used
everywhere, but
A/B tests can
● very often majority of training data will
come from feedback loop
● try to account for this, e.g. with
weighting
● establish process for frequent
retraining
● think of it as part of
your MVP product
● as without it you’re
just guessing that
things work
● use real
distributions for
offline testing
● and ensure it is
aligned with what
you see live
11
Undeclared consumers
Image source:https://www.flickr.com/photos/texese/106442115 (labeled for reuse)
When your system is so great,
that everyone wants to use it,
not necessarily letting you know about it…
And then you improve it - are they happy?
12
OLX way of handling the data
Catalog
Data lake
Amazon S3 AWS GlueAmazon
EMR
Reservoir
Reservoir
Reservoir
Reservoir
Reservoir
Reservoir
13
Data dependencies
Image source:https://de.wikipedia.org/wiki/Datei:Data.jpg
ML model = algorithm + data
What happens when Google
changes ranking algorithm?
What will happen to our models
when the incoming data
changes?
Do we really need all these
features?
14
Robust feature encoding example
Before (on raw data):
● one hot encoded on id
● no encoded hierarchy
● extremely sensitive to any
changes
After (on enhanced data):
● encoding the hierarchy
● using names to have
meaningful features
● still data dependent
(as ML will always be)
● should survive our
challenges though
Challenges - what will happen:
● when we split large category into more sub-categories?
● when merge subcategories?
● when we do some other changes in hierarchy?
15
Feature consistency in online and offline setting
Model Feature
Aggregation
Information
extracted after
event occured
Database
record
Aggregation
Information
extracted at
event time
User / service
live request
with data
Offline feature extraction
Online feature extraction example
Goal:
Offline (for training)
and online (for live prediction)
feature extraction processes
end up with same feature value
16
Decision cascades
Image source: https://www.maxpixel.net/Cascade-By-The-Sautadet-Cascade-Gard-567383 (labeled for reuse)
Rules are everywhere...
And sometimes it really makes
sense to use them (or another
model) in combination with your
model
But then why this automatic
decision was made? Which part
of system is responsible for it?
Oh, we have very bad automatic
decisions affecting our clients -
how can we fix it?
17
Zoo of rules - how do we manage it?
Image source: https://c1.staticflickr.com/9/8044/8445978554_1d1716447b_b.jpg (marked for reuse)
● define a clear decision logic in single
component of your system
● make it very transparent, allow for partial
decisions and incomplete input decisions
(because you will need it)
● audit every partial decision on every version of
your input
● do not use thresholding inside the rules, make
your component responsible for that
● be careful with machine learning models that
can have a different output distribution after
model updates
● same for rules, be aware what concept they
represent
● allow running simulations of how system would
behave with various settings, including past and
potential future simulations
18
Thresholds in ML models
Photo information: a screenshot from toy example of model evaluation in Amazon Machine Learning
Key facts to remember about:
● every time we retrain the model scores differ
● by evaluating on proper sample we can calibrate
DN18 | Technical Debt in Machine Learning | Jaroslaw Szymczak | OLX

More Related Content

PPTX
DN18 | Demystifying the Buzz in Machine Learning! (This Time for Real) | Dat ...
PDF
DN18 | The Data Janitor Returns | Daniel Molnar | Oberlo/Shopify
PPTX
Interpretable Machine Learning
PDF
Image Caption Generation: Intro to Distributed Tensorflow and Distributed Sco...
PDF
Demystifying Data Science
PPTX
Feedback control for system tuning
PDF
"How Pirelli uses Domino and Plotly for Smart Manufacturing" by Alberto Arrig...
PPTX
Kaggle Days Milan - March 2019
DN18 | Demystifying the Buzz in Machine Learning! (This Time for Real) | Dat ...
DN18 | The Data Janitor Returns | Daniel Molnar | Oberlo/Shopify
Interpretable Machine Learning
Image Caption Generation: Intro to Distributed Tensorflow and Distributed Sco...
Demystifying Data Science
Feedback control for system tuning
"How Pirelli uses Domino and Plotly for Smart Manufacturing" by Alberto Arrig...
Kaggle Days Milan - March 2019

What's hot (20)

PPTX
Helping data scientists escape the seduction of the sandbox - Krish Swamy, We...
PDF
No, you don't need to learn python
PPTX
Webinar - Fraud Detection - Palombo (20160428)
PDF
A Kaggle Talk
PPTX
Emerging engineering issues for building large scale AI systems By Srinivas P...
PDF
Machine Learning Project Lifecycle
PDF
Data Workflows for Machine Learning - Seattle DAML
DOCX
Resume_10_2019
PDF
AI driven classification framework for advanced Test Automation
PDF
Writing Smarter Applications with Machine Learning
PDF
Debugging AI
PDF
BigML Education - Deepnets
PDF
Ideas on Machine Learning Interpretability
PDF
Intro to Azure Machine Learning
PDF
From Lab to Factory: Or how to turn data into value
PDF
Strata 2016 - Lessons Learned from building real-life Machine Learning Systems
PDF
A few Challenges to Make Machine Learning Easy
PDF
Gary Hope - Machine Learning: It's Not as Hard as you Think
PDF
MLSEV Virtual. ML: Business Perspective
PPTX
From Machine Learning to Learning Machines: Creating an End-to-End Cognitive ...
Helping data scientists escape the seduction of the sandbox - Krish Swamy, We...
No, you don't need to learn python
Webinar - Fraud Detection - Palombo (20160428)
A Kaggle Talk
Emerging engineering issues for building large scale AI systems By Srinivas P...
Machine Learning Project Lifecycle
Data Workflows for Machine Learning - Seattle DAML
Resume_10_2019
AI driven classification framework for advanced Test Automation
Writing Smarter Applications with Machine Learning
Debugging AI
BigML Education - Deepnets
Ideas on Machine Learning Interpretability
Intro to Azure Machine Learning
From Lab to Factory: Or how to turn data into value
Strata 2016 - Lessons Learned from building real-life Machine Learning Systems
A few Challenges to Make Machine Learning Easy
Gary Hope - Machine Learning: It's Not as Hard as you Think
MLSEV Virtual. ML: Business Perspective
From Machine Learning to Learning Machines: Creating an End-to-End Cognitive ...
Ad

Similar to DN18 | Technical Debt in Machine Learning | Jaroslaw Szymczak | OLX (20)

PDF
Technical debt in machine learning - Data Natives Berlin 2018
PDF
Pydata Chicago - work hard once
PDF
Model governance in the age of data science & AI
PDF
Clone of an organization
PDF
System Development Life Cycle ( Sdlc )
PPTX
Model Drift Monitoring using Tensorflow Model Analysis
PDF
Real-world Strategies for Debugging Machine Learning Systems
PPTX
SESE 2021: Where Systems Engineering meets AI/ML
PPTX
Introduction to Machine Learning.pptx
PDF
Deconstructing a Machine Learning Pipeline with Virtual Data Lake
PDF
Ai in finance
PDF
Test Bank for Systems Analysis and Design 11th Edition by Tilley
PDF
Test Bank for Systems Analysis and Design 11th Edition by Tilley
DOCX
Smart Traffic Monitoring System Report
DOCX
online movie ticket booking system
PDF
CFA-NY Workshop - Final slides
PDF
Creating a Custom ML Model for your Application - Kotlin/Everywhere
PDF
C2_W1---.pdf
PDF
Automatic machine learning (AutoML) 101
PPTX
Machine Learning AND Deep Learning for OpenPOWER
Technical debt in machine learning - Data Natives Berlin 2018
Pydata Chicago - work hard once
Model governance in the age of data science & AI
Clone of an organization
System Development Life Cycle ( Sdlc )
Model Drift Monitoring using Tensorflow Model Analysis
Real-world Strategies for Debugging Machine Learning Systems
SESE 2021: Where Systems Engineering meets AI/ML
Introduction to Machine Learning.pptx
Deconstructing a Machine Learning Pipeline with Virtual Data Lake
Ai in finance
Test Bank for Systems Analysis and Design 11th Edition by Tilley
Test Bank for Systems Analysis and Design 11th Edition by Tilley
Smart Traffic Monitoring System Report
online movie ticket booking system
CFA-NY Workshop - Final slides
Creating a Custom ML Model for your Application - Kotlin/Everywhere
C2_W1---.pdf
Automatic machine learning (AutoML) 101
Machine Learning AND Deep Learning for OpenPOWER
Ad

More from Dataconomy Media (20)

PDF
Data Natives Paris v 10.0 | "Blockchain in Healthcare" - Lea Dias & David An...
PDF
Data Natives Frankfurt v 11.0 | "Competitive advantages with knowledge graphs...
PDF
Data Natives Frankfurt v 11.0 | "Can we be responsible for misuse of data & a...
PDF
Data Natives Munich v 12.0 | "How to be more productive with Autonomous Data ...
PPTX
Data Natives meets DataRobot | "Build and deploy an anti-money laundering mo...
PPTX
Data Natives Munich v 12.0 | "Political Data Science: A tale of Fake News, So...
PPTX
Data Natives Vienna v 7.0 | "Building Kubernetes Operators with KUDO for Dat...
PDF
Data Natives Vienna v 7.0 | "The Ingredients of Data Innovation" - Robbert de...
PPTX
Data Natives Cologne v 4.0 | "The Data Lorax: Planting the Seeds of Fairness...
PDF
Data Natives Cologne v 4.0 | "How People Analytics Can Reveal the Hidden Aspe...
PPTX
Data Natives Amsterdam v 9.0 | "Ten Little Servers: A Story of no Downtime" -...
PDF
Data Natives Amsterdam v 9.0 | "Point in Time Labeling at Scale" - Timothy Th...
PDF
Data Natives Hamburg v 6.0 | "Interpersonal behavior: observing Alex to under...
PDF
Data Natives Hamburg v 6.0 | "About Surfing, Failing & Scaling" - Florian Sch...
PDF
Data NativesBerlin v 20.0 | "Serving A/B experimentation platform end-to-end"...
PPTX
Data Natives Berlin v 20.0 | "Ten Little Servers: A Story of no Downtime" - A...
PDF
Big Data Frankfurt meets Thinkport | "The Cloud as a Driver of Innovation" - ...
PPTX
Thinkport meets Frankfurt | "Financial Time Series Analysis using Wavelets" -...
PPTX
Big Data Helsinki v 3 | "Distributed Machine and Deep Learning at Scale with ...
PPTX
Big Data Helsinki v 3 | "Federated Learning and Privacy-preserving AI" - Oguz...
Data Natives Paris v 10.0 | "Blockchain in Healthcare" - Lea Dias & David An...
Data Natives Frankfurt v 11.0 | "Competitive advantages with knowledge graphs...
Data Natives Frankfurt v 11.0 | "Can we be responsible for misuse of data & a...
Data Natives Munich v 12.0 | "How to be more productive with Autonomous Data ...
Data Natives meets DataRobot | "Build and deploy an anti-money laundering mo...
Data Natives Munich v 12.0 | "Political Data Science: A tale of Fake News, So...
Data Natives Vienna v 7.0 | "Building Kubernetes Operators with KUDO for Dat...
Data Natives Vienna v 7.0 | "The Ingredients of Data Innovation" - Robbert de...
Data Natives Cologne v 4.0 | "The Data Lorax: Planting the Seeds of Fairness...
Data Natives Cologne v 4.0 | "How People Analytics Can Reveal the Hidden Aspe...
Data Natives Amsterdam v 9.0 | "Ten Little Servers: A Story of no Downtime" -...
Data Natives Amsterdam v 9.0 | "Point in Time Labeling at Scale" - Timothy Th...
Data Natives Hamburg v 6.0 | "Interpersonal behavior: observing Alex to under...
Data Natives Hamburg v 6.0 | "About Surfing, Failing & Scaling" - Florian Sch...
Data NativesBerlin v 20.0 | "Serving A/B experimentation platform end-to-end"...
Data Natives Berlin v 20.0 | "Ten Little Servers: A Story of no Downtime" - A...
Big Data Frankfurt meets Thinkport | "The Cloud as a Driver of Innovation" - ...
Thinkport meets Frankfurt | "Financial Time Series Analysis using Wavelets" -...
Big Data Helsinki v 3 | "Distributed Machine and Deep Learning at Scale with ...
Big Data Helsinki v 3 | "Federated Learning and Privacy-preserving AI" - Oguz...

Recently uploaded (20)

PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PPTX
Introduction to Knowledge Engineering Part 1
PDF
Fluorescence-microscope_Botany_detailed content
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PPTX
oil_refinery_comprehensive_20250804084928 (1).pptx
PPT
ISS -ESG Data flows What is ESG and HowHow
PDF
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PPTX
IBA_Chapter_11_Slides_Final_Accessible.pptx
PPTX
Data_Analytics_and_PowerBI_Presentation.pptx
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PDF
Lecture1 pattern recognition............
PPTX
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PPTX
STERILIZATION AND DISINFECTION-1.ppthhhbx
PDF
[EN] Industrial Machine Downtime Prediction
PPTX
Introduction-to-Cloud-ComputingFinal.pptx
PPTX
1_Introduction to advance data techniques.pptx
PPTX
Qualitative Qantitative and Mixed Methods.pptx
PPT
Reliability_Chapter_ presentation 1221.5784
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Introduction to Knowledge Engineering Part 1
Fluorescence-microscope_Botany_detailed content
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
oil_refinery_comprehensive_20250804084928 (1).pptx
ISS -ESG Data flows What is ESG and HowHow
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
IBA_Chapter_11_Slides_Final_Accessible.pptx
Data_Analytics_and_PowerBI_Presentation.pptx
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
Lecture1 pattern recognition............
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
STERILIZATION AND DISINFECTION-1.ppthhhbx
[EN] Industrial Machine Downtime Prediction
Introduction-to-Cloud-ComputingFinal.pptx
1_Introduction to advance data techniques.pptx
Qualitative Qantitative and Mixed Methods.pptx
Reliability_Chapter_ presentation 1221.5784

DN18 | Technical Debt in Machine Learning | Jaroslaw Szymczak | OLX

  • 1. Technical debt in ML by Jaroslaw Szymczak, Senior Data Scientist @ OLX Group
  • 2. 2 Agenda ● Introduction ● Basic concepts ● Components of technical debt in machine learning... ● … and how can we tackle them ● Q&A
  • 3. 3 Few words about OLX 350+ million active users 40+ countries 60+ million new listings per month Market leader in 35 countries
  • 4. 4 ● M. Sc. in computer science with speciality in machine learning ● Senior Data Scientist @ OLX Group ● Focusing on content quality as well as trust and safety topics ● Responsible for full ML projects lifecycle - research, productization, development and maintenance ● Having experience in delivering anti-fraud solutions for tier one European insurance companies as well as retail and investment banks ● Worked on external data science projects for churn prediction, sales estimation and predictive maintenance for various companies in Germany and Poland And few words about me jaroslaw.szymczak@olx.com
  • 5. Basic concepts What is technical debt? How this concept work with relation to ML?
  • 6. 6 Technical debt Technical debt is a concept in software development that reflects the implied cost of additional rework caused by choosing an easy solution now instead of using a better approach that would take longer. (by Wikipedia) ● Main components increasing technical debt: ○ lack of testing ○ inadequate system monitoring ○ code complexity ○ “dependency jungle” ○ lack of documentation (especially painful in connection with high staff turnover) ● Main reasons of technical debt: ○ time pressure ○ using prototypes as base for production system ○ lack of technical debt awareness
  • 7. 7 Technical debt in machine learning Technical debt in machine learning is a usual technical debt plus more. ML has unique capability of increasing the debt in extremely fast pace. Image source: https://c.pxhere.com/photos/29/fb/money_euro_coin_coins_bank_note_calculator_budget_save-1021960.jpg!d (labelled for reuse)
  • 8. Components of technical debt in ML Or at least some of them
  • 9. 9 (Hidden) feedback loops Image source: https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/General_closed_loop_feedback_system.svg/400px-General_closed_loop_feedback_system.svg.png When system is retrained on the data it has provided… and what’s worse - when you measure performance on such data only...
  • 10. 10 Breaking the loop Sampling Model retraining Testing & monitoring There’s an area for footnotes too! ● should be seen as a necessity, not as optional feature ● make sure to make it unbiased ● or take bias into account ● cannot be used everywhere, but A/B tests can ● very often majority of training data will come from feedback loop ● try to account for this, e.g. with weighting ● establish process for frequent retraining ● think of it as part of your MVP product ● as without it you’re just guessing that things work ● use real distributions for offline testing ● and ensure it is aligned with what you see live
  • 11. 11 Undeclared consumers Image source:https://www.flickr.com/photos/texese/106442115 (labeled for reuse) When your system is so great, that everyone wants to use it, not necessarily letting you know about it… And then you improve it - are they happy?
  • 12. 12 OLX way of handling the data Catalog Data lake Amazon S3 AWS GlueAmazon EMR Reservoir Reservoir Reservoir Reservoir Reservoir Reservoir
  • 13. 13 Data dependencies Image source:https://de.wikipedia.org/wiki/Datei:Data.jpg ML model = algorithm + data What happens when Google changes ranking algorithm? What will happen to our models when the incoming data changes? Do we really need all these features?
  • 14. 14 Robust feature encoding example Before (on raw data): ● one hot encoded on id ● no encoded hierarchy ● extremely sensitive to any changes After (on enhanced data): ● encoding the hierarchy ● using names to have meaningful features ● still data dependent (as ML will always be) ● should survive our challenges though Challenges - what will happen: ● when we split large category into more sub-categories? ● when merge subcategories? ● when we do some other changes in hierarchy?
  • 15. 15 Feature consistency in online and offline setting Model Feature Aggregation Information extracted after event occured Database record Aggregation Information extracted at event time User / service live request with data Offline feature extraction Online feature extraction example Goal: Offline (for training) and online (for live prediction) feature extraction processes end up with same feature value
  • 16. 16 Decision cascades Image source: https://www.maxpixel.net/Cascade-By-The-Sautadet-Cascade-Gard-567383 (labeled for reuse) Rules are everywhere... And sometimes it really makes sense to use them (or another model) in combination with your model But then why this automatic decision was made? Which part of system is responsible for it? Oh, we have very bad automatic decisions affecting our clients - how can we fix it?
  • 17. 17 Zoo of rules - how do we manage it? Image source: https://c1.staticflickr.com/9/8044/8445978554_1d1716447b_b.jpg (marked for reuse) ● define a clear decision logic in single component of your system ● make it very transparent, allow for partial decisions and incomplete input decisions (because you will need it) ● audit every partial decision on every version of your input ● do not use thresholding inside the rules, make your component responsible for that ● be careful with machine learning models that can have a different output distribution after model updates ● same for rules, be aware what concept they represent ● allow running simulations of how system would behave with various settings, including past and potential future simulations
  • 18. 18 Thresholds in ML models Photo information: a screenshot from toy example of model evaluation in Amazon Machine Learning Key facts to remember about: ● every time we retrain the model scores differ ● by evaluating on proper sample we can calibrate