SlideShare uma empresa Scribd logo
1 de 54
Baixar para ler offline
EMERGING BEST PRACTICES FOR
MACHINE LEARNING ENGINEERING
Lex Toumbourou
2
Ready to
make your
mark?
/careers
©ThoughtWorks 2019 Commercial in Confidence
3
©ThoughtWorks 2019 Commercial in Confidence
Emerging Best Practises
for
Machine Learning Engineering
Lex Toumbourou
©ThoughtWorks 2019 Commercial in Confidence 4
Why this talk?
● Aimed at individuals and organisations getting
started with Machine Learning.
● Reduce uncertainty, cost and time to deliver.
● Based on my own experience, my colleagues and
various other authors.
Photo by Ken Treloar on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 5
Talk overview
● Review of best practises or “sensible defaults” in
software projects.
● Consider challenges that ML projects introduce.
● Practises by ML projects phases.
Photo by Casey Horner on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 6
Motivating example
● Predict how long a pet will take to be
adopted based on its profile.
● Combination of structured, NLP and
image data.
● Generates a continual supply of
training data.
Petfinder.my Adoption Prediction
https://www.kaggle.com/c/petfinder-adoption-prediction
©ThoughtWorks 2019 Commercial in Confidence 7
Terminology
● Supervised learning - process of learning a predictive function from training a dataset of
input / output pairs.
● Model - another name for the learned function and its parameters.
● Features - another word for inputs of model (sometimes engineered).
● Training set - whole collection of feature -> output pairs used to train model.
● Validation set - set of training data set aside to tune model.
● Test set - set of data used to evaluate model.
Review of terminology used throughout talk
©ThoughtWorks 2019 Commercial in Confidence
Part 1. Software engineering
“best practises”
©ThoughtWorks 2019 Commercial in Confidence 9
Waterfall
● Based on the assumption that
sufficient upfront planning would
save time and money from rework
later in project
● Slow feedback loop
● Doesn’t account for unforeseeable
complexity
©ThoughtWorks 2019 Commercial in Confidence 10
Iterative/Agile development
● Work in cycles (“sprints”) of
requirements, design, code and,
release.
● Rapid Application Development (RAD),
Rational Unified Process, XP
Programming, Scrum, Kanban etc.
https://blog.itil.org/2014/08/allgemein/what-it-
service-management-can-learn-from-the-agile-
manifesto-and-vice-versa/
©ThoughtWorks 2019 Commercial in Confidence 11
Modern software excellence
● Continuous delivery.
● Fast feedback.
● Rigorous testing.
● Continuous integration.
● Sophisticated version control.
● Infrastructure as code (DevOps).
From Continuous Deliver in a Nutshell by Zaiku
©ThoughtWorks 2019 Commercial in Confidence
Part 2: Challenges of ML
projects
©ThoughtWorks 2019 Commercial in Confidence 13
Uncertain of outcomes
● Paradigm shift for product managers.
● Is this even a problem I can effectively
solve with Machine Learning?
Photo by Miguel Bruna on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 14
Training data requirements
● Unstructured problems: collecting big datasets (used
to be) a big barrier to entry.
● Structured datasets in the wild are often spread
across multiple sources with different governance
policies
Source unknown
©ThoughtWorks 2019 Commercial in Confidence 15
Reproducibility requirements
● State must be consistent to allow
experiments to build upon each
other.
● Large datasets and artifacts don’t fit
into traditional version control tools
Photo by 85Fifteen on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 16
Slow feedback
● Large models can take from hours to days
to train.
● Models can be fiddly and difficult to train.
Photo by Nick Abrams on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 17
Model drift
● Models trained to make predictions on
today’s data have no guarantees they will
work on future data.
Photo by Josh Yang ∙ White. ∙ . on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 18
Blackbox-ness
● Hard to assess “correctness”.
● Production results may differ from
dev results.
● New class of concerns for QA and
support.
Photo by Emily Morter on Unsplash
©ThoughtWorks 2019 Commercial in Confidence
Part 3: Phases of ML projects
©ThoughtWorks 2019 Commercial in Confidence 20
ML project overview
Plan
Collect
PrepareTrain
Deploy
©ThoughtWorks 2019 Commercial in Confidence 21
Project-wide practises
Photo by Hunter Haley on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 22
Focus on product not tech
● Can you validate it without training any
models?
● Is there a open-source or vendor
solution that will get you close?
● Tip: if you use a vendor solution, you still
need to evaluate its performance with a
test set
Project-wide practises
Photo by Nicolas Hoizey on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 23
Fast cycle time
● Start small and increase complexity as
needed.
● “If you're not embarrassed by the first
version of your product (model), you've
launched too late” - Reid Hoffman
Project-wide practises
Photo by Fabian Bächli on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 24
Consistent code structure
● Document where to put things and
create a linter-enforce style guide.
http://flake8.pycqa.org/en/latest/
● Cookie cutter data science to reduce
“bike-shedding” and decision fatigue
https://github.com/drivendata/cooki
ecutter-data-science
Project-wide practises
Photo by Dan Ritson on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 25
1. Plan
2. Collect
3. Prepare
4. Train
5. Deploy
Plan
Photo by NORTHFOLK on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 26
Consider implications
● What happens if the model is bad?
● What are the implications of what
I’m optimising?
● Do we need a human in the loop?
Plan
https://www.slideshare.net/ThoughtWorks/social-implications-of-bias-in-
machine-learning-fiona-coath-by-thoughtworks-133798261
©ThoughtWorks 2019 Commercial in Confidence 27
Pick an evaluation metric
● “Main” (even single) evaluation metric
based on after considering your problem
and data understanding.
https://www.coursera.org/lecture/machine-learning-
projects/single-number-evaluation-metric-wIKkC
● Baseline metric predicting at random or
majority class predictions.
Plan
https://www.biochemia-
medica.com/en/journal/22/3/10.11613/BM.2012.031
©ThoughtWorks 2019 Commercial in Confidence 28
Plan test set
● Test set should be production data.
● Test set shouldn’t overlap with training
set.
● Newer data is (usually) most
important.
Plan
©ThoughtWorks 2019 Commercial in Confidence 29
Determine run criteria
● How will our production infrastructure
constrain our model?
● How fast does the inference need to
be?
Plan
Photo by NORTHFOLK on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 30
Collect
1. Plan
2. Collect
3. Prepare
4. Train
5. Deploy
Photo by Phad Pichetbovornkul on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 31
Data scientist builds dataset
● If you are building models, you should have a
good understanding of how the dataset was
collected.
● Active learning can make this fast.
https://platform.ai/ https://prodi.gy
Collect
Building labelled dataset with platform.ai
©ThoughtWorks 2019 Commercial in Confidence 32
Small data first
● Small datasets can (sometimes) go a long way.
● Transfer learning for image classification,
natural language processing and even
structured data.
Collect
Photo by Ayo Ogunseinde on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 33
More data > solution complexity
● “Most people overestimate the cost
associated with gathering and labeling
data, and underestimate the hardship
of solving problems in a data starved
environment.” - Emmanuel Ameisen
https://blog.insightdatascience.com/ho
w-to-deliver-on-machine-learning-
projects-c8d82ce642b0
Collect
Photo by Simon Maage on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 34
Share collected data
● Package and share collected
datasets.
https://dvc.org https://quiltdata.com
● Encourage centralised &
compliant storage (data lakes).
Collect
https://quiltdata.com/
©ThoughtWorks 2019 Commercial in Confidence 35
Prepare
1. Plan
2. Collect
3. Prepare
4. Train
5. Deploy
©ThoughtWorks 2019 Commercial in Confidence 36
Look at your data
● Look at random
examples.
● Histograms.
● Missingno for missing
number visualizations.
https://github.com/ResidentMario
/missingno
Prepare
©ThoughtWorks 2019 Commercial in Confidence 37
ML-driven exploratory analysis (EDA)
● Aim to train a model fast then use
interpretability and SME knowledge to guide
feature engineering and data collection.
From Fast.ai’s Machine Learning for Coders
● GBM (XGBoost, LightGBM, Catboost)
software can handle missing values,
categorical values and varying scales out the
box.
Prepare
©ThoughtWorks 2019 Commercial in Confidence 38
Version artifacts and pipelines
● Version control artifacts.
● Track the pipelines used to generate
features. https://dvc.org
● Pipenv & Poetry for tracking dependencies
chains.
https://pipenv.readthedocs.io/en/latest/
https://github.com/sdispater/poetry
Prepare
©ThoughtWorks 2019 Commercial in Confidence 39
Practise good code hygiene
● Test-driven development for feature
engineering code: unit, integration, etc
● Refactor into modules.
● Fix bugs with your features before
worrying about hyperparameters.
Prepare
Photo by Piron Guillaume on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 40
Train
1. Plan
2. Collect
3. Prepare
4. Train
5. Deploy
Photo by Fancycrave on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 41
“Easiest” models first
● Favour simple, interpretable models
initially.
● GBMs are great default choice for
structured data.
Train
https://towardsdatascience.com/interpretable-machine-learning-
with-xgboost-9ec80d148d27
©ThoughtWorks 2019 Commercial in Confidence 42
Fast feedback
● Overfit first.
● Train on samples or small images etc
while testing experiments: Aim to keep
training time < 5 minutes.
● Val set from the same distribution as
test set
Train
https://www.bridgewateruk.com/2016/08/working-large-company-vs-working-
small-company-pros-cons/
©ThoughtWorks 2019 Commercial in Confidence 43
Transfer learning
● (Almost) always start with a
pretrained model if possible.
● Transfer learning for image
classification and recently natural
language processing.
Universal Language Model Fine-tuning for Text
Classification
BERT: Pre-training of Deep Bidirectional Transformers
for Language Understanding
Train
https://machinelearningmastery.com/transfer-learning-for-deep-learning/
©ThoughtWorks 2019 Commercial in Confidence 44
Constrain training to run criteria
● Constrain model selection to
suit run criteria.
● CatBoost, as alternative to
XGBoost, support fast
inference and model size
regularization
Train
©ThoughtWorks 2019 Commercial in Confidence 45
Perform error analysis
● Error analysis by hand: look at 100
examples of errors and determine
common themes.
● View most confidence and least
confident predicts.
● Feature importance and ablation.
Train
From https://www.kdnuggets.com/2018/01/error-analysis-your-rescue.html
based on ideas by Andrew Ng
©ThoughtWorks 2019 Commercial in Confidence 46
Deploy
1. Plan
2. Collect
3. Prepare
4. Train
5. Deploy
Photo by Agto Nugroho on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 47
Go to prod early
● Test your model on data and
conditions in prod early.
● A/B deployments: new model
receives inputs alongside production
model to compare performance.
Deploy
Model
A
Model
B
©ThoughtWorks 2019 Commercial in Confidence 48
Validate inputs (and outputs)
● Fast feedback on prod data not
accounted for in training / test set.
● Pydantic validates using Python types.
https://github.com/samuelcolvin/pydanti
c
Deploy
Photo by Fancycrave on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 49
Minimise ops
● Aim for Serverless and low infrastructure.
● Automate deployments.
● Developers and data scientists on call.
Deploy
©ThoughtWorks 2019 Commercial in Confidence 50
Monitor metric
● Monitor metric by continually building
new test sets.
● Track performance over time.
● Schedule retraining.
Deploy
Photo by Kyle Hanson on Unsplash
©ThoughtWorks 2019 Commercial in Confidence 51
Accessible interpretability tools
● Data scientist should create
tools to make model
accessible to all.
● Interpretability dashboards to
make predictions against real
data and view interpretations.
https://www.thoughtworks.com/clients/ark
ose-labs
Deploy
"Why Should I Trust You?": Explaining the Predictions of Any Classifier
A Unified Approach to Interpreting Model Predictions
©ThoughtWorks 2019 Commercial in Confidence
Conclusion
● Research is uncertain but we can define clear goals.
● Data can be collected iteratively.
● Carefully track data, artifacts and pipelines for
reproducibility.
● Aim for fast feedback while training models.
● Deploy early and monitor production.
● Make interpretability tools accessible to the organisation.
©ThoughtWorks 2019 Commercial in Confidence
Thank you
53
Lex Toumbourou
lext@thoughtworks.com
@lexandstuff
54
Questions?

Mais conteúdo relacionado

Mais procurados

Lean Portfolio Strategy Part 1: Visualizing your Strategy Flow for Transparen...
Lean Portfolio Strategy Part 1: Visualizing your Strategy Flow for Transparen...Lean Portfolio Strategy Part 1: Visualizing your Strategy Flow for Transparen...
Lean Portfolio Strategy Part 1: Visualizing your Strategy Flow for Transparen...Cprime
 
Business transformation trends and smart methodology
Business transformation trends and smart methodologyBusiness transformation trends and smart methodology
Business transformation trends and smart methodologyParticipium
 
Manoj - IT Oranisation Transformation using POPIT
Manoj - IT Oranisation Transformation using POPITManoj - IT Oranisation Transformation using POPIT
Manoj - IT Oranisation Transformation using POPITManoj Agarwal
 
IT Agility How to Enable Workforce and Workspace Ttransformation
IT Agility How to Enable Workforce and Workspace TtransformationIT Agility How to Enable Workforce and Workspace Ttransformation
IT Agility How to Enable Workforce and Workspace TtransformationBen Turner
 
Keeping Pace - Government's technology transformation
Keeping Pace - Government's technology transformationKeeping Pace - Government's technology transformation
Keeping Pace - Government's technology transformationDeloitte UK
 
Build your Own Technology Roadmap!
Build your Own Technology Roadmap!Build your Own Technology Roadmap!
Build your Own Technology Roadmap!Sascha Wenninger
 
Businesses ‘doing digital’ versus ‘digital businesses’
Businesses ‘doing digital’ versus ‘digital businesses’Businesses ‘doing digital’ versus ‘digital businesses’
Businesses ‘doing digital’ versus ‘digital businesses’Enterprise Ireland
 
Business Transformation in the Subscription Economy (Accelerate East)
Business Transformation in the Subscription Economy (Accelerate East)Business Transformation in the Subscription Economy (Accelerate East)
Business Transformation in the Subscription Economy (Accelerate East)Zuora, Inc.
 
A "Hollywood Model" for the Digital Transformation Office
A "Hollywood Model" for the Digital Transformation OfficeA "Hollywood Model" for the Digital Transformation Office
A "Hollywood Model" for the Digital Transformation OfficeDentsu Aegis Network
 
What’s the Role of a Business Analyst in Digital Transformation?
What’s the Role of a Business Analyst in Digital Transformation?What’s the Role of a Business Analyst in Digital Transformation?
What’s the Role of a Business Analyst in Digital Transformation?Anadea
 
What is Digital Transformation?
What is Digital Transformation?What is Digital Transformation?
What is Digital Transformation?David Broderick
 
Digital Transformation Case Study | anynines
Digital Transformation Case Study | anynines Digital Transformation Case Study | anynines
Digital Transformation Case Study | anynines anynines GmbH
 
Digital Transformation: Embracing the new digital reality
Digital Transformation: Embracing the new digital realityDigital Transformation: Embracing the new digital reality
Digital Transformation: Embracing the new digital realityEduserv
 
Digital Transformation Consulting Proposal
Digital Transformation Consulting ProposalDigital Transformation Consulting Proposal
Digital Transformation Consulting ProposalBizzmaxx
 
ScaleupAlly Overview Deck
ScaleupAlly Overview DeckScaleupAlly Overview Deck
ScaleupAlly Overview DeckScaleupAlly
 
Embedded Decision Analysis
Embedded Decision AnalysisEmbedded Decision Analysis
Embedded Decision AnalysisSmartOrg
 
Future of business transformation market research summary
Future of business transformation market research summaryFuture of business transformation market research summary
Future of business transformation market research summaryTieto Corporation
 

Mais procurados (20)

Lean Portfolio Strategy Part 1: Visualizing your Strategy Flow for Transparen...
Lean Portfolio Strategy Part 1: Visualizing your Strategy Flow for Transparen...Lean Portfolio Strategy Part 1: Visualizing your Strategy Flow for Transparen...
Lean Portfolio Strategy Part 1: Visualizing your Strategy Flow for Transparen...
 
Business transformation trends and smart methodology
Business transformation trends and smart methodologyBusiness transformation trends and smart methodology
Business transformation trends and smart methodology
 
Manoj - IT Oranisation Transformation using POPIT
Manoj - IT Oranisation Transformation using POPITManoj - IT Oranisation Transformation using POPIT
Manoj - IT Oranisation Transformation using POPIT
 
IT Agility How to Enable Workforce and Workspace Ttransformation
IT Agility How to Enable Workforce and Workspace TtransformationIT Agility How to Enable Workforce and Workspace Ttransformation
IT Agility How to Enable Workforce and Workspace Ttransformation
 
Keeping Pace - Government's technology transformation
Keeping Pace - Government's technology transformationKeeping Pace - Government's technology transformation
Keeping Pace - Government's technology transformation
 
Build your Own Technology Roadmap!
Build your Own Technology Roadmap!Build your Own Technology Roadmap!
Build your Own Technology Roadmap!
 
Businesses ‘doing digital’ versus ‘digital businesses’
Businesses ‘doing digital’ versus ‘digital businesses’Businesses ‘doing digital’ versus ‘digital businesses’
Businesses ‘doing digital’ versus ‘digital businesses’
 
Business Transformation in the Subscription Economy (Accelerate East)
Business Transformation in the Subscription Economy (Accelerate East)Business Transformation in the Subscription Economy (Accelerate East)
Business Transformation in the Subscription Economy (Accelerate East)
 
Venture Path
Venture PathVenture Path
Venture Path
 
A "Hollywood Model" for the Digital Transformation Office
A "Hollywood Model" for the Digital Transformation OfficeA "Hollywood Model" for the Digital Transformation Office
A "Hollywood Model" for the Digital Transformation Office
 
Experimenting with Values
Experimenting with ValuesExperimenting with Values
Experimenting with Values
 
Digital transformation strategy
Digital transformation strategyDigital transformation strategy
Digital transformation strategy
 
What’s the Role of a Business Analyst in Digital Transformation?
What’s the Role of a Business Analyst in Digital Transformation?What’s the Role of a Business Analyst in Digital Transformation?
What’s the Role of a Business Analyst in Digital Transformation?
 
What is Digital Transformation?
What is Digital Transformation?What is Digital Transformation?
What is Digital Transformation?
 
Digital Transformation Case Study | anynines
Digital Transformation Case Study | anynines Digital Transformation Case Study | anynines
Digital Transformation Case Study | anynines
 
Digital Transformation: Embracing the new digital reality
Digital Transformation: Embracing the new digital realityDigital Transformation: Embracing the new digital reality
Digital Transformation: Embracing the new digital reality
 
Digital Transformation Consulting Proposal
Digital Transformation Consulting ProposalDigital Transformation Consulting Proposal
Digital Transformation Consulting Proposal
 
ScaleupAlly Overview Deck
ScaleupAlly Overview DeckScaleupAlly Overview Deck
ScaleupAlly Overview Deck
 
Embedded Decision Analysis
Embedded Decision AnalysisEmbedded Decision Analysis
Embedded Decision Analysis
 
Future of business transformation market research summary
Future of business transformation market research summaryFuture of business transformation market research summary
Future of business transformation market research summary
 

Semelhante a Emerging Best Practises for Machine Learning Engineering- Lex Toumbourou (By ThoughtWorks)

Emerging Best Practises for Machine Learning Engineering (Canberra Meetup edits)
Emerging Best Practises for Machine Learning Engineering (Canberra Meetup edits)Emerging Best Practises for Machine Learning Engineering (Canberra Meetup edits)
Emerging Best Practises for Machine Learning Engineering (Canberra Meetup edits)Lex Toumbourou
 
Continuous Delivery for Machine Learning
Continuous Delivery for Machine LearningContinuous Delivery for Machine Learning
Continuous Delivery for Machine LearningThoughtworks
 
Agile Mumbai 2022 - Ashwinee Singh | Agile in AI or AI in Agile?
Agile Mumbai 2022 - Ashwinee Singh | Agile in AI or AI in Agile?Agile Mumbai 2022 - Ashwinee Singh | Agile in AI or AI in Agile?
Agile Mumbai 2022 - Ashwinee Singh | Agile in AI or AI in Agile?AgileNetwork
 
Agile Chennai 2023 | Unleashing Agility: Triumphs Over Challenges in Legacy M...
Agile Chennai 2023 | Unleashing Agility: Triumphs Over Challenges in Legacy M...Agile Chennai 2023 | Unleashing Agility: Triumphs Over Challenges in Legacy M...
Agile Chennai 2023 | Unleashing Agility: Triumphs Over Challenges in Legacy M...AgileNetwork
 
Agile Fundamentals One Step Guide for Agile Projects(Handout).pdf
Agile Fundamentals One Step Guide for Agile Projects(Handout).pdfAgile Fundamentals One Step Guide for Agile Projects(Handout).pdf
Agile Fundamentals One Step Guide for Agile Projects(Handout).pdfTuan Yang
 
CD4ML - ThoughtWorks MeetUp Munich Christoph Windheuser May 8th 2019
CD4ML - ThoughtWorks MeetUp Munich Christoph Windheuser May 8th 2019CD4ML - ThoughtWorks MeetUp Munich Christoph Windheuser May 8th 2019
CD4ML - ThoughtWorks MeetUp Munich Christoph Windheuser May 8th 2019Christoph Windheuser
 
Best Practices for Implementing Self-Service Analytics
Best Practices for Implementing Self-Service AnalyticsBest Practices for Implementing Self-Service Analytics
Best Practices for Implementing Self-Service AnalyticsMattSaxton5
 
Project definition workshop #disummit 2019
Project definition workshop #disummit 2019Project definition workshop #disummit 2019
Project definition workshop #disummit 2019Python Predictions
 
Vers l'entreprise agile
Vers l'entreprise agileVers l'entreprise agile
Vers l'entreprise agileHerve Lourdin
 
July 29: Achieve Stakeholder Alignment on Governance: Navigator by Pivotal Labs
July 29: Achieve Stakeholder Alignment on Governance: Navigator by Pivotal LabsJuly 29: Achieve Stakeholder Alignment on Governance: Navigator by Pivotal Labs
July 29: Achieve Stakeholder Alignment on Governance: Navigator by Pivotal LabsVMware Tanzu
 
Chapter FifteenAgile Project Management© 2021 McGraw Hill.
Chapter FifteenAgile Project Management© 2021 McGraw Hill.Chapter FifteenAgile Project Management© 2021 McGraw Hill.
Chapter FifteenAgile Project Management© 2021 McGraw Hill.JinElias52
 
Guide to end end machine learning projects
Guide to end end machine learning projectsGuide to end end machine learning projects
Guide to end end machine learning projectsSkyl.ai
 
aw_survivalguide_r2opt
aw_survivalguide_r2optaw_survivalguide_r2opt
aw_survivalguide_r2optReza Abed
 
Big data and other buzzwords
Big data and other buzzwordsBig data and other buzzwords
Big data and other buzzwordsAndrew Clark
 
Tips for automation project final
Tips for automation project finalTips for automation project final
Tips for automation project finalMassimo Cappello
 
Scaling Your Enterprise With Data Science
Scaling Your Enterprise With Data ScienceScaling Your Enterprise With Data Science
Scaling Your Enterprise With Data ScienceSuperFluid Labs
 
How Business Acceleration Cloud is Revolutionizing Software Sales
How Business Acceleration Cloud is Revolutionizing Software SalesHow Business Acceleration Cloud is Revolutionizing Software Sales
How Business Acceleration Cloud is Revolutionizing Software SalesCloudShare
 
Lecture 2
Lecture 2Lecture 2
Lecture 29anm12
 

Semelhante a Emerging Best Practises for Machine Learning Engineering- Lex Toumbourou (By ThoughtWorks) (20)

Emerging Best Practises for Machine Learning Engineering (Canberra Meetup edits)
Emerging Best Practises for Machine Learning Engineering (Canberra Meetup edits)Emerging Best Practises for Machine Learning Engineering (Canberra Meetup edits)
Emerging Best Practises for Machine Learning Engineering (Canberra Meetup edits)
 
Continuous Delivery for Machine Learning
Continuous Delivery for Machine LearningContinuous Delivery for Machine Learning
Continuous Delivery for Machine Learning
 
Why more than half of ML models don't make it to production
Why more than half of ML models don't make it to productionWhy more than half of ML models don't make it to production
Why more than half of ML models don't make it to production
 
Agile Mumbai 2022 - Ashwinee Singh | Agile in AI or AI in Agile?
Agile Mumbai 2022 - Ashwinee Singh | Agile in AI or AI in Agile?Agile Mumbai 2022 - Ashwinee Singh | Agile in AI or AI in Agile?
Agile Mumbai 2022 - Ashwinee Singh | Agile in AI or AI in Agile?
 
Agile Chennai 2023 | Unleashing Agility: Triumphs Over Challenges in Legacy M...
Agile Chennai 2023 | Unleashing Agility: Triumphs Over Challenges in Legacy M...Agile Chennai 2023 | Unleashing Agility: Triumphs Over Challenges in Legacy M...
Agile Chennai 2023 | Unleashing Agility: Triumphs Over Challenges in Legacy M...
 
Agile Fundamentals One Step Guide for Agile Projects(Handout).pdf
Agile Fundamentals One Step Guide for Agile Projects(Handout).pdfAgile Fundamentals One Step Guide for Agile Projects(Handout).pdf
Agile Fundamentals One Step Guide for Agile Projects(Handout).pdf
 
CD4ML - ThoughtWorks MeetUp Munich Christoph Windheuser May 8th 2019
CD4ML - ThoughtWorks MeetUp Munich Christoph Windheuser May 8th 2019CD4ML - ThoughtWorks MeetUp Munich Christoph Windheuser May 8th 2019
CD4ML - ThoughtWorks MeetUp Munich Christoph Windheuser May 8th 2019
 
Best Practices for Implementing Self-Service Analytics
Best Practices for Implementing Self-Service AnalyticsBest Practices for Implementing Self-Service Analytics
Best Practices for Implementing Self-Service Analytics
 
Project definition workshop #disummit 2019
Project definition workshop #disummit 2019Project definition workshop #disummit 2019
Project definition workshop #disummit 2019
 
Vers l'entreprise agile
Vers l'entreprise agileVers l'entreprise agile
Vers l'entreprise agile
 
July 29: Achieve Stakeholder Alignment on Governance: Navigator by Pivotal Labs
July 29: Achieve Stakeholder Alignment on Governance: Navigator by Pivotal LabsJuly 29: Achieve Stakeholder Alignment on Governance: Navigator by Pivotal Labs
July 29: Achieve Stakeholder Alignment on Governance: Navigator by Pivotal Labs
 
Chapter FifteenAgile Project Management© 2021 McGraw Hill.
Chapter FifteenAgile Project Management© 2021 McGraw Hill.Chapter FifteenAgile Project Management© 2021 McGraw Hill.
Chapter FifteenAgile Project Management© 2021 McGraw Hill.
 
L'entreprise agile
L'entreprise agileL'entreprise agile
L'entreprise agile
 
Guide to end end machine learning projects
Guide to end end machine learning projectsGuide to end end machine learning projects
Guide to end end machine learning projects
 
aw_survivalguide_r2opt
aw_survivalguide_r2optaw_survivalguide_r2opt
aw_survivalguide_r2opt
 
Big data and other buzzwords
Big data and other buzzwordsBig data and other buzzwords
Big data and other buzzwords
 
Tips for automation project final
Tips for automation project finalTips for automation project final
Tips for automation project final
 
Scaling Your Enterprise With Data Science
Scaling Your Enterprise With Data ScienceScaling Your Enterprise With Data Science
Scaling Your Enterprise With Data Science
 
How Business Acceleration Cloud is Revolutionizing Software Sales
How Business Acceleration Cloud is Revolutionizing Software SalesHow Business Acceleration Cloud is Revolutionizing Software Sales
How Business Acceleration Cloud is Revolutionizing Software Sales
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 

Mais de Thoughtworks

Design System as a Product
Design System as a ProductDesign System as a Product
Design System as a ProductThoughtworks
 
Designers, Developers & Dogs
Designers, Developers & DogsDesigners, Developers & Dogs
Designers, Developers & DogsThoughtworks
 
Cloud-first for fast innovation
Cloud-first for fast innovationCloud-first for fast innovation
Cloud-first for fast innovationThoughtworks
 
More impact with flexible teams
More impact with flexible teamsMore impact with flexible teams
More impact with flexible teamsThoughtworks
 
Culture of Innovation
Culture of InnovationCulture of Innovation
Culture of InnovationThoughtworks
 
Developer Experience
Developer ExperienceDeveloper Experience
Developer ExperienceThoughtworks
 
When we design together
When we design togetherWhen we design together
When we design togetherThoughtworks
 
Hardware is hard(er)
Hardware is hard(er)Hardware is hard(er)
Hardware is hard(er)Thoughtworks
 
Customer-centric innovation enabled by cloud
 Customer-centric innovation enabled by cloud Customer-centric innovation enabled by cloud
Customer-centric innovation enabled by cloudThoughtworks
 
Amazon's Culture of Innovation
Amazon's Culture of InnovationAmazon's Culture of Innovation
Amazon's Culture of InnovationThoughtworks
 
When in doubt, go live
When in doubt, go liveWhen in doubt, go live
When in doubt, go liveThoughtworks
 
Don't cross the Rubicon
Don't cross the RubiconDon't cross the Rubicon
Don't cross the RubiconThoughtworks
 
Your test coverage is a lie!
Your test coverage is a lie!Your test coverage is a lie!
Your test coverage is a lie!Thoughtworks
 
Docker container security
Docker container securityDocker container security
Docker container securityThoughtworks
 
Redefining the unit
Redefining the unitRedefining the unit
Redefining the unitThoughtworks
 
Technology Radar Webinar UK - Vol. 22
Technology Radar Webinar UK - Vol. 22Technology Radar Webinar UK - Vol. 22
Technology Radar Webinar UK - Vol. 22Thoughtworks
 
A Tribute to Turing
A Tribute to TuringA Tribute to Turing
A Tribute to TuringThoughtworks
 
Rsa maths worked out
Rsa maths worked outRsa maths worked out
Rsa maths worked outThoughtworks
 

Mais de Thoughtworks (20)

Design System as a Product
Design System as a ProductDesign System as a Product
Design System as a Product
 
Designers, Developers & Dogs
Designers, Developers & DogsDesigners, Developers & Dogs
Designers, Developers & Dogs
 
Cloud-first for fast innovation
Cloud-first for fast innovationCloud-first for fast innovation
Cloud-first for fast innovation
 
More impact with flexible teams
More impact with flexible teamsMore impact with flexible teams
More impact with flexible teams
 
Culture of Innovation
Culture of InnovationCulture of Innovation
Culture of Innovation
 
Dual-Track Agile
Dual-Track AgileDual-Track Agile
Dual-Track Agile
 
Developer Experience
Developer ExperienceDeveloper Experience
Developer Experience
 
When we design together
When we design togetherWhen we design together
When we design together
 
Hardware is hard(er)
Hardware is hard(er)Hardware is hard(er)
Hardware is hard(er)
 
Customer-centric innovation enabled by cloud
 Customer-centric innovation enabled by cloud Customer-centric innovation enabled by cloud
Customer-centric innovation enabled by cloud
 
Amazon's Culture of Innovation
Amazon's Culture of InnovationAmazon's Culture of Innovation
Amazon's Culture of Innovation
 
When in doubt, go live
When in doubt, go liveWhen in doubt, go live
When in doubt, go live
 
Don't cross the Rubicon
Don't cross the RubiconDon't cross the Rubicon
Don't cross the Rubicon
 
Error handling
Error handlingError handling
Error handling
 
Your test coverage is a lie!
Your test coverage is a lie!Your test coverage is a lie!
Your test coverage is a lie!
 
Docker container security
Docker container securityDocker container security
Docker container security
 
Redefining the unit
Redefining the unitRedefining the unit
Redefining the unit
 
Technology Radar Webinar UK - Vol. 22
Technology Radar Webinar UK - Vol. 22Technology Radar Webinar UK - Vol. 22
Technology Radar Webinar UK - Vol. 22
 
A Tribute to Turing
A Tribute to TuringA Tribute to Turing
A Tribute to Turing
 
Rsa maths worked out
Rsa maths worked outRsa maths worked out
Rsa maths worked out
 

Último

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 

Último (20)

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 

Emerging Best Practises for Machine Learning Engineering- Lex Toumbourou (By ThoughtWorks)

  • 1. EMERGING BEST PRACTICES FOR MACHINE LEARNING ENGINEERING Lex Toumbourou
  • 3. 3 ©ThoughtWorks 2019 Commercial in Confidence Emerging Best Practises for Machine Learning Engineering Lex Toumbourou
  • 4. ©ThoughtWorks 2019 Commercial in Confidence 4 Why this talk? ● Aimed at individuals and organisations getting started with Machine Learning. ● Reduce uncertainty, cost and time to deliver. ● Based on my own experience, my colleagues and various other authors. Photo by Ken Treloar on Unsplash
  • 5. ©ThoughtWorks 2019 Commercial in Confidence 5 Talk overview ● Review of best practises or “sensible defaults” in software projects. ● Consider challenges that ML projects introduce. ● Practises by ML projects phases. Photo by Casey Horner on Unsplash
  • 6. ©ThoughtWorks 2019 Commercial in Confidence 6 Motivating example ● Predict how long a pet will take to be adopted based on its profile. ● Combination of structured, NLP and image data. ● Generates a continual supply of training data. Petfinder.my Adoption Prediction https://www.kaggle.com/c/petfinder-adoption-prediction
  • 7. ©ThoughtWorks 2019 Commercial in Confidence 7 Terminology ● Supervised learning - process of learning a predictive function from training a dataset of input / output pairs. ● Model - another name for the learned function and its parameters. ● Features - another word for inputs of model (sometimes engineered). ● Training set - whole collection of feature -> output pairs used to train model. ● Validation set - set of training data set aside to tune model. ● Test set - set of data used to evaluate model. Review of terminology used throughout talk
  • 8. ©ThoughtWorks 2019 Commercial in Confidence Part 1. Software engineering “best practises”
  • 9. ©ThoughtWorks 2019 Commercial in Confidence 9 Waterfall ● Based on the assumption that sufficient upfront planning would save time and money from rework later in project ● Slow feedback loop ● Doesn’t account for unforeseeable complexity
  • 10. ©ThoughtWorks 2019 Commercial in Confidence 10 Iterative/Agile development ● Work in cycles (“sprints”) of requirements, design, code and, release. ● Rapid Application Development (RAD), Rational Unified Process, XP Programming, Scrum, Kanban etc. https://blog.itil.org/2014/08/allgemein/what-it- service-management-can-learn-from-the-agile- manifesto-and-vice-versa/
  • 11. ©ThoughtWorks 2019 Commercial in Confidence 11 Modern software excellence ● Continuous delivery. ● Fast feedback. ● Rigorous testing. ● Continuous integration. ● Sophisticated version control. ● Infrastructure as code (DevOps). From Continuous Deliver in a Nutshell by Zaiku
  • 12. ©ThoughtWorks 2019 Commercial in Confidence Part 2: Challenges of ML projects
  • 13. ©ThoughtWorks 2019 Commercial in Confidence 13 Uncertain of outcomes ● Paradigm shift for product managers. ● Is this even a problem I can effectively solve with Machine Learning? Photo by Miguel Bruna on Unsplash
  • 14. ©ThoughtWorks 2019 Commercial in Confidence 14 Training data requirements ● Unstructured problems: collecting big datasets (used to be) a big barrier to entry. ● Structured datasets in the wild are often spread across multiple sources with different governance policies Source unknown
  • 15. ©ThoughtWorks 2019 Commercial in Confidence 15 Reproducibility requirements ● State must be consistent to allow experiments to build upon each other. ● Large datasets and artifacts don’t fit into traditional version control tools Photo by 85Fifteen on Unsplash
  • 16. ©ThoughtWorks 2019 Commercial in Confidence 16 Slow feedback ● Large models can take from hours to days to train. ● Models can be fiddly and difficult to train. Photo by Nick Abrams on Unsplash
  • 17. ©ThoughtWorks 2019 Commercial in Confidence 17 Model drift ● Models trained to make predictions on today’s data have no guarantees they will work on future data. Photo by Josh Yang ∙ White. ∙ . on Unsplash
  • 18. ©ThoughtWorks 2019 Commercial in Confidence 18 Blackbox-ness ● Hard to assess “correctness”. ● Production results may differ from dev results. ● New class of concerns for QA and support. Photo by Emily Morter on Unsplash
  • 19. ©ThoughtWorks 2019 Commercial in Confidence Part 3: Phases of ML projects
  • 20. ©ThoughtWorks 2019 Commercial in Confidence 20 ML project overview Plan Collect PrepareTrain Deploy
  • 21. ©ThoughtWorks 2019 Commercial in Confidence 21 Project-wide practises Photo by Hunter Haley on Unsplash
  • 22. ©ThoughtWorks 2019 Commercial in Confidence 22 Focus on product not tech ● Can you validate it without training any models? ● Is there a open-source or vendor solution that will get you close? ● Tip: if you use a vendor solution, you still need to evaluate its performance with a test set Project-wide practises Photo by Nicolas Hoizey on Unsplash
  • 23. ©ThoughtWorks 2019 Commercial in Confidence 23 Fast cycle time ● Start small and increase complexity as needed. ● “If you're not embarrassed by the first version of your product (model), you've launched too late” - Reid Hoffman Project-wide practises Photo by Fabian Bächli on Unsplash
  • 24. ©ThoughtWorks 2019 Commercial in Confidence 24 Consistent code structure ● Document where to put things and create a linter-enforce style guide. http://flake8.pycqa.org/en/latest/ ● Cookie cutter data science to reduce “bike-shedding” and decision fatigue https://github.com/drivendata/cooki ecutter-data-science Project-wide practises Photo by Dan Ritson on Unsplash
  • 25. ©ThoughtWorks 2019 Commercial in Confidence 25 1. Plan 2. Collect 3. Prepare 4. Train 5. Deploy Plan Photo by NORTHFOLK on Unsplash
  • 26. ©ThoughtWorks 2019 Commercial in Confidence 26 Consider implications ● What happens if the model is bad? ● What are the implications of what I’m optimising? ● Do we need a human in the loop? Plan https://www.slideshare.net/ThoughtWorks/social-implications-of-bias-in- machine-learning-fiona-coath-by-thoughtworks-133798261
  • 27. ©ThoughtWorks 2019 Commercial in Confidence 27 Pick an evaluation metric ● “Main” (even single) evaluation metric based on after considering your problem and data understanding. https://www.coursera.org/lecture/machine-learning- projects/single-number-evaluation-metric-wIKkC ● Baseline metric predicting at random or majority class predictions. Plan https://www.biochemia- medica.com/en/journal/22/3/10.11613/BM.2012.031
  • 28. ©ThoughtWorks 2019 Commercial in Confidence 28 Plan test set ● Test set should be production data. ● Test set shouldn’t overlap with training set. ● Newer data is (usually) most important. Plan
  • 29. ©ThoughtWorks 2019 Commercial in Confidence 29 Determine run criteria ● How will our production infrastructure constrain our model? ● How fast does the inference need to be? Plan Photo by NORTHFOLK on Unsplash
  • 30. ©ThoughtWorks 2019 Commercial in Confidence 30 Collect 1. Plan 2. Collect 3. Prepare 4. Train 5. Deploy Photo by Phad Pichetbovornkul on Unsplash
  • 31. ©ThoughtWorks 2019 Commercial in Confidence 31 Data scientist builds dataset ● If you are building models, you should have a good understanding of how the dataset was collected. ● Active learning can make this fast. https://platform.ai/ https://prodi.gy Collect Building labelled dataset with platform.ai
  • 32. ©ThoughtWorks 2019 Commercial in Confidence 32 Small data first ● Small datasets can (sometimes) go a long way. ● Transfer learning for image classification, natural language processing and even structured data. Collect Photo by Ayo Ogunseinde on Unsplash
  • 33. ©ThoughtWorks 2019 Commercial in Confidence 33 More data > solution complexity ● “Most people overestimate the cost associated with gathering and labeling data, and underestimate the hardship of solving problems in a data starved environment.” - Emmanuel Ameisen https://blog.insightdatascience.com/ho w-to-deliver-on-machine-learning- projects-c8d82ce642b0 Collect Photo by Simon Maage on Unsplash
  • 34. ©ThoughtWorks 2019 Commercial in Confidence 34 Share collected data ● Package and share collected datasets. https://dvc.org https://quiltdata.com ● Encourage centralised & compliant storage (data lakes). Collect https://quiltdata.com/
  • 35. ©ThoughtWorks 2019 Commercial in Confidence 35 Prepare 1. Plan 2. Collect 3. Prepare 4. Train 5. Deploy
  • 36. ©ThoughtWorks 2019 Commercial in Confidence 36 Look at your data ● Look at random examples. ● Histograms. ● Missingno for missing number visualizations. https://github.com/ResidentMario /missingno Prepare
  • 37. ©ThoughtWorks 2019 Commercial in Confidence 37 ML-driven exploratory analysis (EDA) ● Aim to train a model fast then use interpretability and SME knowledge to guide feature engineering and data collection. From Fast.ai’s Machine Learning for Coders ● GBM (XGBoost, LightGBM, Catboost) software can handle missing values, categorical values and varying scales out the box. Prepare
  • 38. ©ThoughtWorks 2019 Commercial in Confidence 38 Version artifacts and pipelines ● Version control artifacts. ● Track the pipelines used to generate features. https://dvc.org ● Pipenv & Poetry for tracking dependencies chains. https://pipenv.readthedocs.io/en/latest/ https://github.com/sdispater/poetry Prepare
  • 39. ©ThoughtWorks 2019 Commercial in Confidence 39 Practise good code hygiene ● Test-driven development for feature engineering code: unit, integration, etc ● Refactor into modules. ● Fix bugs with your features before worrying about hyperparameters. Prepare Photo by Piron Guillaume on Unsplash
  • 40. ©ThoughtWorks 2019 Commercial in Confidence 40 Train 1. Plan 2. Collect 3. Prepare 4. Train 5. Deploy Photo by Fancycrave on Unsplash
  • 41. ©ThoughtWorks 2019 Commercial in Confidence 41 “Easiest” models first ● Favour simple, interpretable models initially. ● GBMs are great default choice for structured data. Train https://towardsdatascience.com/interpretable-machine-learning- with-xgboost-9ec80d148d27
  • 42. ©ThoughtWorks 2019 Commercial in Confidence 42 Fast feedback ● Overfit first. ● Train on samples or small images etc while testing experiments: Aim to keep training time < 5 minutes. ● Val set from the same distribution as test set Train https://www.bridgewateruk.com/2016/08/working-large-company-vs-working- small-company-pros-cons/
  • 43. ©ThoughtWorks 2019 Commercial in Confidence 43 Transfer learning ● (Almost) always start with a pretrained model if possible. ● Transfer learning for image classification and recently natural language processing. Universal Language Model Fine-tuning for Text Classification BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding Train https://machinelearningmastery.com/transfer-learning-for-deep-learning/
  • 44. ©ThoughtWorks 2019 Commercial in Confidence 44 Constrain training to run criteria ● Constrain model selection to suit run criteria. ● CatBoost, as alternative to XGBoost, support fast inference and model size regularization Train
  • 45. ©ThoughtWorks 2019 Commercial in Confidence 45 Perform error analysis ● Error analysis by hand: look at 100 examples of errors and determine common themes. ● View most confidence and least confident predicts. ● Feature importance and ablation. Train From https://www.kdnuggets.com/2018/01/error-analysis-your-rescue.html based on ideas by Andrew Ng
  • 46. ©ThoughtWorks 2019 Commercial in Confidence 46 Deploy 1. Plan 2. Collect 3. Prepare 4. Train 5. Deploy Photo by Agto Nugroho on Unsplash
  • 47. ©ThoughtWorks 2019 Commercial in Confidence 47 Go to prod early ● Test your model on data and conditions in prod early. ● A/B deployments: new model receives inputs alongside production model to compare performance. Deploy Model A Model B
  • 48. ©ThoughtWorks 2019 Commercial in Confidence 48 Validate inputs (and outputs) ● Fast feedback on prod data not accounted for in training / test set. ● Pydantic validates using Python types. https://github.com/samuelcolvin/pydanti c Deploy Photo by Fancycrave on Unsplash
  • 49. ©ThoughtWorks 2019 Commercial in Confidence 49 Minimise ops ● Aim for Serverless and low infrastructure. ● Automate deployments. ● Developers and data scientists on call. Deploy
  • 50. ©ThoughtWorks 2019 Commercial in Confidence 50 Monitor metric ● Monitor metric by continually building new test sets. ● Track performance over time. ● Schedule retraining. Deploy Photo by Kyle Hanson on Unsplash
  • 51. ©ThoughtWorks 2019 Commercial in Confidence 51 Accessible interpretability tools ● Data scientist should create tools to make model accessible to all. ● Interpretability dashboards to make predictions against real data and view interpretations. https://www.thoughtworks.com/clients/ark ose-labs Deploy "Why Should I Trust You?": Explaining the Predictions of Any Classifier A Unified Approach to Interpreting Model Predictions
  • 52. ©ThoughtWorks 2019 Commercial in Confidence Conclusion ● Research is uncertain but we can define clear goals. ● Data can be collected iteratively. ● Carefully track data, artifacts and pipelines for reproducibility. ● Aim for fast feedback while training models. ● Deploy early and monitor production. ● Make interpretability tools accessible to the organisation.
  • 53. ©ThoughtWorks 2019 Commercial in Confidence Thank you 53 Lex Toumbourou lext@thoughtworks.com @lexandstuff