SlideShare uma empresa Scribd logo
1 de 30
Baixar para ler offline
Machine Learning Interpretability:
the key to ML adoption in the enterprise
Alberto Danese
About me
• Senior Data Scientist @ Cerved
since 2016
• Innovation & Data Sources Team
Background
• Manager @ EY
• Senior Consultant @ Between
• Computer Engineer @ Politecnico
di Milano (2007)
• Active kaggler since 2016 (albedan)
• Just 8 competitions completed so
far
Day time Night time
• Kaggle Grandmaster after my 6th
competition
• 6 gold medals, 4 solo gold, 1 solo
prize in masters only competition
Talk overview
• Why ML Interpretability is key
• How (and when) to use ML Interpretability
• Drill-down on methods, techniques and approaches
Why ML Interpretability is key
AI & ML history in a nutshell
Early days
(1940s –
1970s):
• Turing test
• Dartmouth
workshop
• First neural
network and
perceptrons AI winter(s)
(1970s – early 1990s)
AI success and new developments
(from the early 1990s)
• Achievements cover by media
• Deep Blue vs Kasparov (1996-97)
• AlphaGo vs Lee Sedol (2016)
• Tech (HW) advancements
• GPUs (2006)
• TPUs (2016)
• Free and open source languages and
frameworks
• Competitions and culture
• Netflix prize (2006)
• Kaggle (2010)
• HBR – Data scientist: the sexiest
job of 21st century (2012)
And now, in 2019
Let’s use some simple logic:
• 60 years of AI
• 20 years of advancements
and accomplishments
• 1 cultural change
AI & ML solutions are now widely
deployed in production, across all
industries and companies
Right?
And now, in 2019 (hype-free)
• It’s Still Early Days for Machine Learning Adoption[1]
• Nearly half (49%) of the 11,400+ data specialists who
took O’Reilly’s survey in June 2018 indicated they were
in the exploration phase of machine learning and have
not deployed any machine learning models into
production
A two-speed world
Technology-first companies
• Large use of ML in production
• Very frequent use, at scale, often
on not critical topics (movie
recommendations, targeted ads)
Well-established companies
(banks, insurances, healthcare)
• More POCs than actual
deployments
• Crucial but not so frequent
decisions (accepting a mortgage
request, health diagnosis)
• Why? Trust & communication, i.e. ML
Interpretability
• Humans need explanations –
especially regulators – and classic
statistical methods (e.g. linear
regressions) are easily interpretable
• Till a few years ago, many ML
models were complete black boxes
ML interpretability besides regulation
• Husky vs. Wolf classification as in the
paper “Why should I trust you”[2]
1. The authors trained a biased classifier
(on purpose): every wolf picture had
snow in the background
2. They asked 27 ML students if they
trusted the model and to highlight
potential features (with and without
ML interpretability)
• Other areas where interpretability
matters: hacking / adversarial attacks
Is snow a key feature?
Yes, for 25 out of 27
Is snow a key feature?
Yes, for 12 out of 27
How (and when) to use ML
Interpretability
Let’s agree on the basics
1. Interpretability: the ability to explain or to present in understandable terms to
a human[3]
2. Accuracy vs. Interpretability is a tradeoff[4], i.e. you can get:
• Accurate models with approximate explanations
• Approximate models with accurate explanations
3. Global vs. Local Interpretability[4]:
• Global: explain how the model works in predicting unseen data
• Local: explain the "reason" of a specific prediction (i.e. of a single record)
4. Model agnostic vs. model specific interpretability models
Four levels of interpretability
Know your data
Before building a model
After the
model has
been built
(globally)
After the
model has
been built
(locally)
• Enforcing specific properties in a model, to allow for a better
understanding of its internal behaviour
• Fine tuning what the model is optimizing
• Showing global behaviour of the model, i.e. the relation between
the predicted target and one or more variables
• Giving more information on a specific prediction, e.g. what features
impacted that prediction the most
• Your model is only as interpretable as your data
• Understand processes / responsabilities on data
F
O
C
U
S
0
1
2 3
My quick framework
• Name and main concepts of the interpretability model / approach
• When is it applied ( before / after building the model)
• Where it applies ( local / global)
• Other notes / restrictions (model agnostic or specific, etc.)
• What can you say if you use this method / approach
• Main focus on structured data
B A
GL
Drill down on methods,
techniques and approaches
Monotonicity constraints (1/2)
• Main concepts:
• Some features are expected to show a monotonic behaviour (constantly non-descending or
non-ascending with respect to the target variable)
• Usually, due to the specific training set, a tree-based greedy model (e.g. GBT) is likely to
"catch up" irregularities, even when the overall trend is non-descending or non-ascending
• Enforcing a monotonic constraint, a specific tree-based model only "accepts" splits that are
in line with the constraint
• This can help limiting overfitting if the monotonic behaviour is consistent
• Monotonicity constraints are applied before building a model
• They act globally and are specific of tree-based models
• When you enforce a monotonic constraint on feature X with respect to target Y,
you can safely say: when all other features are equal, there’s no way that
increasing X will result in a decreasing prediction of Y
1 B G
Monotonicity constraints (2/2)
• Let’s take a simple parabola with
added gaussian noise
• It’s a one feature, one target
problem
1 B G
Monotonicity constraints (2/2)
• Let’s fit a simple Lightgbm
• Overall a decent fit, but locally it
can show a decreasing trend
1 B G
Monotonicity constraints (2/2)
• Let’s add this to the lgb
parameters:
• +1 = non-descending
• 0 = no constraint
• -1 = non-ascending
• Much better fit!
1 B G
Monotonicity constraints (2/2)
• If I set -1 as monotonic constraint,
the model doesn’t even find a
single valid split
1 B G
Monotonicity constraints (2/2)
• Actually the model with the
correct constraint not only gives a
degree of explainability, it’s also
the best performing model!
1 B G
Other examples
• Build a model that optimizes a custom metric
• Custom evaluation function
• Custom objective function
• When you apply custom objective and/or evaluation functions, you can
say: my model (in)directly optimizes this specific metric
1 B G
Partial dependence plots (1/2)2 A G
• Main concepts:
• Once you have highlighted the most important features, it is useful to understand how these
features affect the predictions
• The partial dependence plots "average out" the other variables and usually represents the
effect of one or two features with respect to the outcome[7]
• PDP analysis is performed after a model has been built and is a global measure,
typically model-agnostic
• With PDP, you can say: on average, the predictions have this specific behaviour
with respect to this one variable (or two of them)
Partial dependence plots (2/2)2 A G
Partial Dependence Plots 2-features PDP
LIME (1/2)3
• Main concepts:
• LIME stands for Local Interpretable Model-Agnostic Explanations
• It assumes that, locally, complex models can be approximated with simpler linear models
• It’s based on 4 phases, starting from the single prediction we want to explain
• Perturbations: alter your dataset and get the black box predictions for new observations
• Weighting: the new samples are weighted by their proximity to the instance of interest
• Fitting: a weighted, interpretable model is fitted on the perturbed dataset
• Explanation: of the (simple) local model
• It works on tabular data, text and images and it’s completely model-agnostic
• With LIME, you can say: this specific prediction is affected by these features, each
with its own relevance
A L
LIME (2/2)3 A L
Built with R package "lime"
First, build an explainer with data and a model (here, a classic
XGBoost)
Then, create explanations specifying the number N of
features you want to include
Other examples
• Shapley additive explanations
• Uses game theory to explain predictions
• For each prediction, you get the contribution of each variable to that specific case
• Natively a local model, can be extended to analyze globally the behaviour of a model
• Fast implementation for GBTs available
• With Shapley, you can say: in this specific prediction, each feature gives this exact
contribution
3 A L
ML Interpretability – Recap & Examples
Need Example Approach
Enforce some kind of expected
behaviour in a ML model
Real estate: floor surface vs. house price for two
identical apartments (location, quality, etc.)
Enforce monotonicity before
building a ML model
Show the effects of different
features on a specific target,
across a large population
Healthcare: most important variables that are
linked to a form of illness and what their impact is
Feature importance + PDPs
Understand a single prediction
and possibly define ad hoc
strategies based on individual
analysis
Customer churn: for each customer in the top N%
likely to churn, identify the main reason(s) and
give actionable insights to define individual
marketing campaigns[10]
LIME + Shapley
A L
A G
B G1
2
3
Wrap up
ML Interpretability – Conclusions
• Regulation, human nature and in general the desire of fair, robust and transparent
models are all good reasons to dig into ML interpretability
• There are many ways to make a ML model interpretable with radically distinct
approaches, but always consider:
• Data first
• Tricks and expedients to use before building a model
• Ex-post global explanations
• Ex-post local explanations
• This field had a tremendous growth in the last 2-3 years and currently allows high-
performance models (like GBTs) to have a more than reasonable level of interpretability
• An interpretable model can be more robust, insightful, actionable… simply better
References
• [1] https://www.datanami.com/2018/08/07/its-still-early-days-for-machine-learning-adoption/
• [2] "Why Should I Trust You?": Explaining the Predictions of Any Classifier – Marco Tulio Ribeiro, Sameer Singh, Carlos Guestrin (2016) – https://arxiv.org/abs/1602.04938
• [3] Towards A Rigorous Science of Interpretable Machine Learning – Finale Doshi-Velez, Been Kim (2017) - https://arxiv.org/abs/1702.08608
• [4] An introduction to Machine Learning Interpretability – Patrick Hall and Navdeep Gill – O’Reilly
• [5] https://github.com/dmlc/xgboost/blob/master/R-package/demo/custom_objective.R
• [6] https://medium.com/the-artificial-impostor/feature-importance-measures-for-tree-models-part-i-47f187c1a2c3
• [7] https://bgreenwell.github.io/pdp/articles/pdp-example-xgboost.html
• [8] https://christophm.github.io/interpretable-ml-book/
• [9] https://github.com/slundberg/shap
• [10] https://medium.com/civis-analytics/demystifying-black-box-models-with-shap-value-analysis-3e20b536fc80
• Icons made by Freepik from www.flaticon.com
Thank you!

Mais conteúdo relacionado

Mais procurados

Mais procurados (19)

Strata 2016 - Lessons Learned from building real-life Machine Learning Systems
Strata 2016 -  Lessons Learned from building real-life Machine Learning SystemsStrata 2016 -  Lessons Learned from building real-life Machine Learning Systems
Strata 2016 - Lessons Learned from building real-life Machine Learning Systems
 
Explainable AI - making ML and DL models more interpretable
Explainable AI - making ML and DL models more interpretableExplainable AI - making ML and DL models more interpretable
Explainable AI - making ML and DL models more interpretable
 
Introduction to machine learning and applications (1)
Introduction to machine learning and applications (1)Introduction to machine learning and applications (1)
Introduction to machine learning and applications (1)
 
Data Workflows for Machine Learning - Seattle DAML
Data Workflows for Machine Learning - Seattle DAMLData Workflows for Machine Learning - Seattle DAML
Data Workflows for Machine Learning - Seattle DAML
 
Unified Approach to Interpret Machine Learning Model: SHAP + LIME
Unified Approach to Interpret Machine Learning Model: SHAP + LIMEUnified Approach to Interpret Machine Learning Model: SHAP + LIME
Unified Approach to Interpret Machine Learning Model: SHAP + LIME
 
Learning to Learn Model Behavior ( Capital One: data intelligence conference )
Learning to Learn Model Behavior ( Capital One: data intelligence conference )Learning to Learn Model Behavior ( Capital One: data intelligence conference )
Learning to Learn Model Behavior ( Capital One: data intelligence conference )
 
機器學習速遊
機器學習速遊機器學習速遊
機器學習速遊
 
孔令傑 / 給工程師的統計學及資料分析 123 (2016/9/4)
孔令傑 / 給工程師的統計學及資料分析 123 (2016/9/4)孔令傑 / 給工程師的統計學及資料分析 123 (2016/9/4)
孔令傑 / 給工程師的統計學及資料分析 123 (2016/9/4)
 
DutchMLSchool. Logistic Regression, Deepnets, Time Series
DutchMLSchool. Logistic Regression, Deepnets, Time SeriesDutchMLSchool. Logistic Regression, Deepnets, Time Series
DutchMLSchool. Logistic Regression, Deepnets, Time Series
 
A Kaggle Talk
A Kaggle TalkA Kaggle Talk
A Kaggle Talk
 
DutchMLSchool. ML: A Technical Perspective
DutchMLSchool. ML: A Technical PerspectiveDutchMLSchool. ML: A Technical Perspective
DutchMLSchool. ML: A Technical Perspective
 
A Friendly Introduction to Machine Learning
A Friendly Introduction to Machine LearningA Friendly Introduction to Machine Learning
A Friendly Introduction to Machine Learning
 
A data science observatory based on RAMP - rapid analytics and model prototyping
A data science observatory based on RAMP - rapid analytics and model prototypingA data science observatory based on RAMP - rapid analytics and model prototyping
A data science observatory based on RAMP - rapid analytics and model prototyping
 
Machine learning with Big Data power point presentation
Machine learning with Big Data power point presentationMachine learning with Big Data power point presentation
Machine learning with Big Data power point presentation
 
Machine learning the high interest credit card of technical debt [PWL]
Machine learning the high interest credit card of technical debt [PWL]Machine learning the high interest credit card of technical debt [PWL]
Machine learning the high interest credit card of technical debt [PWL]
 
Interpretable Machine Learning
Interpretable Machine LearningInterpretable Machine Learning
Interpretable Machine Learning
 
Learning to learn Model Behavior: How to use "human-in-the-loop" to explain d...
Learning to learn Model Behavior: How to use "human-in-the-loop" to explain d...Learning to learn Model Behavior: How to use "human-in-the-loop" to explain d...
Learning to learn Model Behavior: How to use "human-in-the-loop" to explain d...
 
Ranking and Diversity in Recommendations - RecSys Stammtisch at SoundCloud, B...
Ranking and Diversity in Recommendations - RecSys Stammtisch at SoundCloud, B...Ranking and Diversity in Recommendations - RecSys Stammtisch at SoundCloud, B...
Ranking and Diversity in Recommendations - RecSys Stammtisch at SoundCloud, B...
 
Overview of Machine Learning and its Applications
Overview of Machine Learning and its ApplicationsOverview of Machine Learning and its Applications
Overview of Machine Learning and its Applications
 

Semelhante a Kaggle Days Paris - Alberto Danese - ML Interpretability

Goal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
Goal Decomposition and Abductive Reasoning for Policy Analysis and RefinementGoal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
Goal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
Emil Lupu
 

Semelhante a Kaggle Days Paris - Alberto Danese - ML Interpretability (20)

Goal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
Goal Decomposition and Abductive Reasoning for Policy Analysis and RefinementGoal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
Goal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
 
Continuous Learning Systems: Building ML systems that learn from their mistakes
Continuous Learning Systems: Building ML systems that learn from their mistakesContinuous Learning Systems: Building ML systems that learn from their mistakes
Continuous Learning Systems: Building ML systems that learn from their mistakes
 
ODSC East 2020 : Continuous_learning_systems
ODSC East 2020 : Continuous_learning_systemsODSC East 2020 : Continuous_learning_systems
ODSC East 2020 : Continuous_learning_systems
 
Machine Learning in the Financial Industry
Machine Learning in the Financial IndustryMachine Learning in the Financial Industry
Machine Learning in the Financial Industry
 
Lessons learnt at building recommendation services at industry scale
Lessons learnt at building recommendation services at industry scaleLessons learnt at building recommendation services at industry scale
Lessons learnt at building recommendation services at industry scale
 
OOSD_UNIT1 (1).pptx
OOSD_UNIT1 (1).pptxOOSD_UNIT1 (1).pptx
OOSD_UNIT1 (1).pptx
 
Model-Based User Interface Optimization: Part IV: ADVANCED TOPICS - At SICSA ...
Model-Based User Interface Optimization: Part IV: ADVANCED TOPICS - At SICSA ...Model-Based User Interface Optimization: Part IV: ADVANCED TOPICS - At SICSA ...
Model-Based User Interface Optimization: Part IV: ADVANCED TOPICS - At SICSA ...
 
Choosing a Machine Learning technique to solve your need
Choosing a Machine Learning technique to solve your needChoosing a Machine Learning technique to solve your need
Choosing a Machine Learning technique to solve your need
 
Interpretable ML
Interpretable MLInterpretable ML
Interpretable ML
 
BIG2016- Lessons Learned from building real-life user-focused Big Data systems
BIG2016- Lessons Learned from building real-life user-focused Big Data systemsBIG2016- Lessons Learned from building real-life user-focused Big Data systems
BIG2016- Lessons Learned from building real-life user-focused Big Data systems
 
The Path to Digital Engineering
The Path to Digital EngineeringThe Path to Digital Engineering
The Path to Digital Engineering
 
UNIT-2 Quantitaitive Anlaysis for Mgt Decisions.pptx
UNIT-2 Quantitaitive Anlaysis for Mgt Decisions.pptxUNIT-2 Quantitaitive Anlaysis for Mgt Decisions.pptx
UNIT-2 Quantitaitive Anlaysis for Mgt Decisions.pptx
 
Building Continuous Learning Systems
Building Continuous Learning SystemsBuilding Continuous Learning Systems
Building Continuous Learning Systems
 
Graph Models for Deep Learning
Graph Models for Deep LearningGraph Models for Deep Learning
Graph Models for Deep Learning
 
NYAI #25: Evolution Strategies: An Alternative Approach to AI w/ Maxwell Rebo
NYAI #25: Evolution Strategies: An Alternative Approach to AI w/ Maxwell ReboNYAI #25: Evolution Strategies: An Alternative Approach to AI w/ Maxwell Rebo
NYAI #25: Evolution Strategies: An Alternative Approach to AI w/ Maxwell Rebo
 
5-CEN6016-Chapter1.ppt
5-CEN6016-Chapter1.ppt5-CEN6016-Chapter1.ppt
5-CEN6016-Chapter1.ppt
 
Teechical Report Writing
Teechical Report WritingTeechical Report Writing
Teechical Report Writing
 
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...
 
CEN6016-Chapter1.ppt
CEN6016-Chapter1.pptCEN6016-Chapter1.ppt
CEN6016-Chapter1.ppt
 
CEN6016-Chapter1.ppt
CEN6016-Chapter1.pptCEN6016-Chapter1.ppt
CEN6016-Chapter1.ppt
 

Último

Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
vexqp
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
vexqp
 
Jual Cytotec Asli Obat Aborsi No. 1 Paling Manjur
Jual Cytotec Asli Obat Aborsi No. 1 Paling ManjurJual Cytotec Asli Obat Aborsi No. 1 Paling Manjur
Jual Cytotec Asli Obat Aborsi No. 1 Paling Manjur
ptikerjasaptiker
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
nirzagarg
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Klinik kandungan
 
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
vexqp
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
ahmedjiabur940
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
ranjankumarbehera14
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
nirzagarg
 

Último (20)

Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubai
 
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
 
Harnessing the Power of GenAI for BI and Reporting.pptx
Harnessing the Power of GenAI for BI and Reporting.pptxHarnessing the Power of GenAI for BI and Reporting.pptx
Harnessing the Power of GenAI for BI and Reporting.pptx
 
Jual Cytotec Asli Obat Aborsi No. 1 Paling Manjur
Jual Cytotec Asli Obat Aborsi No. 1 Paling ManjurJual Cytotec Asli Obat Aborsi No. 1 Paling Manjur
Jual Cytotec Asli Obat Aborsi No. 1 Paling Manjur
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATIONCapstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
 
7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
 
Switzerland Constitution 2002.pdf.........
Switzerland Constitution 2002.pdf.........Switzerland Constitution 2002.pdf.........
Switzerland Constitution 2002.pdf.........
 

Kaggle Days Paris - Alberto Danese - ML Interpretability

  • 1. Machine Learning Interpretability: the key to ML adoption in the enterprise Alberto Danese
  • 2. About me • Senior Data Scientist @ Cerved since 2016 • Innovation & Data Sources Team Background • Manager @ EY • Senior Consultant @ Between • Computer Engineer @ Politecnico di Milano (2007) • Active kaggler since 2016 (albedan) • Just 8 competitions completed so far Day time Night time • Kaggle Grandmaster after my 6th competition • 6 gold medals, 4 solo gold, 1 solo prize in masters only competition
  • 3. Talk overview • Why ML Interpretability is key • How (and when) to use ML Interpretability • Drill-down on methods, techniques and approaches
  • 5. AI & ML history in a nutshell Early days (1940s – 1970s): • Turing test • Dartmouth workshop • First neural network and perceptrons AI winter(s) (1970s – early 1990s) AI success and new developments (from the early 1990s) • Achievements cover by media • Deep Blue vs Kasparov (1996-97) • AlphaGo vs Lee Sedol (2016) • Tech (HW) advancements • GPUs (2006) • TPUs (2016) • Free and open source languages and frameworks • Competitions and culture • Netflix prize (2006) • Kaggle (2010) • HBR – Data scientist: the sexiest job of 21st century (2012)
  • 6. And now, in 2019 Let’s use some simple logic: • 60 years of AI • 20 years of advancements and accomplishments • 1 cultural change AI & ML solutions are now widely deployed in production, across all industries and companies Right?
  • 7. And now, in 2019 (hype-free) • It’s Still Early Days for Machine Learning Adoption[1] • Nearly half (49%) of the 11,400+ data specialists who took O’Reilly’s survey in June 2018 indicated they were in the exploration phase of machine learning and have not deployed any machine learning models into production
  • 8. A two-speed world Technology-first companies • Large use of ML in production • Very frequent use, at scale, often on not critical topics (movie recommendations, targeted ads) Well-established companies (banks, insurances, healthcare) • More POCs than actual deployments • Crucial but not so frequent decisions (accepting a mortgage request, health diagnosis) • Why? Trust & communication, i.e. ML Interpretability • Humans need explanations – especially regulators – and classic statistical methods (e.g. linear regressions) are easily interpretable • Till a few years ago, many ML models were complete black boxes
  • 9. ML interpretability besides regulation • Husky vs. Wolf classification as in the paper “Why should I trust you”[2] 1. The authors trained a biased classifier (on purpose): every wolf picture had snow in the background 2. They asked 27 ML students if they trusted the model and to highlight potential features (with and without ML interpretability) • Other areas where interpretability matters: hacking / adversarial attacks Is snow a key feature? Yes, for 25 out of 27 Is snow a key feature? Yes, for 12 out of 27
  • 10. How (and when) to use ML Interpretability
  • 11. Let’s agree on the basics 1. Interpretability: the ability to explain or to present in understandable terms to a human[3] 2. Accuracy vs. Interpretability is a tradeoff[4], i.e. you can get: • Accurate models with approximate explanations • Approximate models with accurate explanations 3. Global vs. Local Interpretability[4]: • Global: explain how the model works in predicting unseen data • Local: explain the "reason" of a specific prediction (i.e. of a single record) 4. Model agnostic vs. model specific interpretability models
  • 12. Four levels of interpretability Know your data Before building a model After the model has been built (globally) After the model has been built (locally) • Enforcing specific properties in a model, to allow for a better understanding of its internal behaviour • Fine tuning what the model is optimizing • Showing global behaviour of the model, i.e. the relation between the predicted target and one or more variables • Giving more information on a specific prediction, e.g. what features impacted that prediction the most • Your model is only as interpretable as your data • Understand processes / responsabilities on data F O C U S 0 1 2 3
  • 13. My quick framework • Name and main concepts of the interpretability model / approach • When is it applied ( before / after building the model) • Where it applies ( local / global) • Other notes / restrictions (model agnostic or specific, etc.) • What can you say if you use this method / approach • Main focus on structured data B A GL
  • 14. Drill down on methods, techniques and approaches
  • 15. Monotonicity constraints (1/2) • Main concepts: • Some features are expected to show a monotonic behaviour (constantly non-descending or non-ascending with respect to the target variable) • Usually, due to the specific training set, a tree-based greedy model (e.g. GBT) is likely to "catch up" irregularities, even when the overall trend is non-descending or non-ascending • Enforcing a monotonic constraint, a specific tree-based model only "accepts" splits that are in line with the constraint • This can help limiting overfitting if the monotonic behaviour is consistent • Monotonicity constraints are applied before building a model • They act globally and are specific of tree-based models • When you enforce a monotonic constraint on feature X with respect to target Y, you can safely say: when all other features are equal, there’s no way that increasing X will result in a decreasing prediction of Y 1 B G
  • 16. Monotonicity constraints (2/2) • Let’s take a simple parabola with added gaussian noise • It’s a one feature, one target problem 1 B G
  • 17. Monotonicity constraints (2/2) • Let’s fit a simple Lightgbm • Overall a decent fit, but locally it can show a decreasing trend 1 B G
  • 18. Monotonicity constraints (2/2) • Let’s add this to the lgb parameters: • +1 = non-descending • 0 = no constraint • -1 = non-ascending • Much better fit! 1 B G
  • 19. Monotonicity constraints (2/2) • If I set -1 as monotonic constraint, the model doesn’t even find a single valid split 1 B G
  • 20. Monotonicity constraints (2/2) • Actually the model with the correct constraint not only gives a degree of explainability, it’s also the best performing model! 1 B G
  • 21. Other examples • Build a model that optimizes a custom metric • Custom evaluation function • Custom objective function • When you apply custom objective and/or evaluation functions, you can say: my model (in)directly optimizes this specific metric 1 B G
  • 22. Partial dependence plots (1/2)2 A G • Main concepts: • Once you have highlighted the most important features, it is useful to understand how these features affect the predictions • The partial dependence plots "average out" the other variables and usually represents the effect of one or two features with respect to the outcome[7] • PDP analysis is performed after a model has been built and is a global measure, typically model-agnostic • With PDP, you can say: on average, the predictions have this specific behaviour with respect to this one variable (or two of them)
  • 23. Partial dependence plots (2/2)2 A G Partial Dependence Plots 2-features PDP
  • 24. LIME (1/2)3 • Main concepts: • LIME stands for Local Interpretable Model-Agnostic Explanations • It assumes that, locally, complex models can be approximated with simpler linear models • It’s based on 4 phases, starting from the single prediction we want to explain • Perturbations: alter your dataset and get the black box predictions for new observations • Weighting: the new samples are weighted by their proximity to the instance of interest • Fitting: a weighted, interpretable model is fitted on the perturbed dataset • Explanation: of the (simple) local model • It works on tabular data, text and images and it’s completely model-agnostic • With LIME, you can say: this specific prediction is affected by these features, each with its own relevance A L
  • 25. LIME (2/2)3 A L Built with R package "lime" First, build an explainer with data and a model (here, a classic XGBoost) Then, create explanations specifying the number N of features you want to include
  • 26. Other examples • Shapley additive explanations • Uses game theory to explain predictions • For each prediction, you get the contribution of each variable to that specific case • Natively a local model, can be extended to analyze globally the behaviour of a model • Fast implementation for GBTs available • With Shapley, you can say: in this specific prediction, each feature gives this exact contribution 3 A L
  • 27. ML Interpretability – Recap & Examples Need Example Approach Enforce some kind of expected behaviour in a ML model Real estate: floor surface vs. house price for two identical apartments (location, quality, etc.) Enforce monotonicity before building a ML model Show the effects of different features on a specific target, across a large population Healthcare: most important variables that are linked to a form of illness and what their impact is Feature importance + PDPs Understand a single prediction and possibly define ad hoc strategies based on individual analysis Customer churn: for each customer in the top N% likely to churn, identify the main reason(s) and give actionable insights to define individual marketing campaigns[10] LIME + Shapley A L A G B G1 2 3
  • 29. ML Interpretability – Conclusions • Regulation, human nature and in general the desire of fair, robust and transparent models are all good reasons to dig into ML interpretability • There are many ways to make a ML model interpretable with radically distinct approaches, but always consider: • Data first • Tricks and expedients to use before building a model • Ex-post global explanations • Ex-post local explanations • This field had a tremendous growth in the last 2-3 years and currently allows high- performance models (like GBTs) to have a more than reasonable level of interpretability • An interpretable model can be more robust, insightful, actionable… simply better
  • 30. References • [1] https://www.datanami.com/2018/08/07/its-still-early-days-for-machine-learning-adoption/ • [2] "Why Should I Trust You?": Explaining the Predictions of Any Classifier – Marco Tulio Ribeiro, Sameer Singh, Carlos Guestrin (2016) – https://arxiv.org/abs/1602.04938 • [3] Towards A Rigorous Science of Interpretable Machine Learning – Finale Doshi-Velez, Been Kim (2017) - https://arxiv.org/abs/1702.08608 • [4] An introduction to Machine Learning Interpretability – Patrick Hall and Navdeep Gill – O’Reilly • [5] https://github.com/dmlc/xgboost/blob/master/R-package/demo/custom_objective.R • [6] https://medium.com/the-artificial-impostor/feature-importance-measures-for-tree-models-part-i-47f187c1a2c3 • [7] https://bgreenwell.github.io/pdp/articles/pdp-example-xgboost.html • [8] https://christophm.github.io/interpretable-ml-book/ • [9] https://github.com/slundberg/shap • [10] https://medium.com/civis-analytics/demystifying-black-box-models-with-shap-value-analysis-3e20b536fc80 • Icons made by Freepik from www.flaticon.com Thank you!