SlideShare a Scribd company logo
1. Introduction - Why do we need Model Interpretability?
2. Eli5 and Permutation Importance
3. LIME - Local Interpretable Model agnostic
Explanations
4. SHAP - Shapley Additive Explanation
5. Microsoft IntepretML
Agenda
Why interpretability is important
Data Science algortihms are used to make lot of cirtical decisions in
various
industries
• Credit Rating
• Disease diagnonsis
• Banks (Loan processing)
• Recommendations (Products , movies)
• Crime control
Why interpretability is important
ExplainDecisions
Improve Models
Strengthen Trust &
Transparency
Satisfy Regulatory
Requirements
Fairness & Transperability in ML Model
Example : Predicting Employees performance in big company
Input Data : Past perfromance reviews of the employees for the last 10
yrs
Caveat : What if company promotes more Men than Women ?
Output : Model will learn the bias and predict favourable result for Men
Models are Opinions Embedded in Mathematics — Cathy O’Neil
Some Models are easy to Interpret
X1
X2
IF 5X1 + 2X2 > 0
OTHERWISE
Savings
Income
X1
X2
X1 > 0.5
X2 > 0.5
Decision TreesLinear / Logistic Regression
Some models are harder to interpret
Ensemble models (random forest, boosting, etc…)
1. Hard to understand the role of each feature
2. Usually comes with feature importance
3. Doesn’t tell us if feature affects decision
positively or negatively
Deep Neural Networks
1. No correlation between the input layer & output
2. Black-box
Should we use only simple model
• Use simple models like Linear or Logessitic regressions , so that you can
explain the results
• Use complex models & use interpredicbility techinques to explain the res
Types of Interpretations
● Local: Explain how and why a specific prediction was made
○ Why did our model predict certain outcome for given a given customer
● Global: Explain how our model works overall
○ What features are important for our model and how do they impact the prediction ?
○ Feature Importance provides amplitude , not direction of impact
ELI5 & Permutation Importance
• Can be used to interpret sklearn-like models
• Works for both Regression & Classification models
• Create nice visualisations for white-box models
o Can be used for local and global interpretation
• Implements Permutation Importance for black-box models
(boosting)
o Only global interpretation
ELI5 – White-box Models
Explain model globally (feature importance):
import eli5
eli5.show_weights(model)
ELI5 – White-box Models
Explain model Locally
import eli5
eli5.show_prediction(model,
observation)
ELI5 – Permutation Importance
• Model Agnostic
• Provides global interpretation
• For each feature:
o Shuffle values in the provided dataset
o Generate predictions using the model on the modified dataset
o Compute the decrease in accuracy vs before shuffling
ELI5 – Permutation Importance
perm = PermutationImportance(model)
perm.fit(X, y)
eli5.show_weights(perm)
LIME - Local Interpretable Model-Agnostic
Explanations
Local: Explains why a single data point was classified as a
specific class
Model-agnostic: Treats the model as a black-box. Doesn’t need to
know how it makes predictions
Paper “Why should I trust you?” published in August 2016.
"Why Should I Trust You?": Explaining the Predictions of Any Classifier
Marco Tulio Ribeiro, Sameer Singh, Carlos Guestrin
Being Model Agnostic
No assumptions about the internal structure…
X1 >0.5
f
Explain any existing, or future, model
Data Decision
F(x
)
Being Local & Model-Agnostic
Source: https://www.youtube.com/watch?v=LAm4QmVaf0E&t=3658s
“Global” explanation is too complicated
Being Local & Model-Agnostic
Source: https://www.youtube.com/watch?v=LAm4QmVaf0E&t=3658s
“Global” explanation is too complicated
Being Local & Model-Agnostic
Source: https://www.youtube.com/watch?v=LAm4QmVaf0E&t=3658s
“Global” explanation is too complicated
Explanation is an interpretable model,
that is locally accurate
LIME - How does it work?
"Why Should I Trust You?": Explaining the Predictions of Any Classifier
Marco Tulio Ribeiro, Sameer Singh, Carlos Guestrin
How LIME Works
1. Permute data -Create new dataset around observation by sampling from
distribution learnt on training data (In the Perturbed dataset for Numerical
features are picked based on the distribution & categorical values based on the
occurrence)
2. Calculate distance between permutations and original observations
3. Use model to predict probability on new points, that’s our new y
4. Pick m features best describing the complex model outcome from the permuted
data
5. Fit a linear model on data in m dimensions weighted by similarity
● Central plot shows importance of the top features for this prediction
○ Value corresponds to the weight of the linear model
○ Direction corresponds to whether it pushes in one way or the
other
● Numerical features are discretized into bins
○ Easier to interpret: weight == contribution / sign of weight ==
direction
How LIME Works
"Why Should I Trust You?": Explaining the Predictions of Any Classifier
Marco Tulio Ribeiro, Sameer Singh, Carlos Guestrin
LIME - Canbe used on images
Lime supports many types of data:
● Tabular Explainer
● Recurrent Tabular Explainer
● Image Explainer
● Text Explainer
LIME Available Explainers
Shapley Additive Explanations(SHAP)
● Anexplanation model is a simpler model that is a good approximation of our
complex model.
● “Additive feature attribution methods”: the local explanation is a linear
combination of the features.
Dataset
Complex Model Prediction
Explainer Explanation
ShapleyAdditive Explanations(SHAP)
● For a given observation, we compute a SHAP value per feature, such that:
sum(SHAP_values_for_obs) = prediction_for_obs - model_expected_value
● Model’s expected value is the average prediction made by our model
How much has each feature contributed to the
prediction compared to the average prediction
House price
Prediction
400,000 €
Average house
price prediction
for all the
apartments
420,000 €
Delta in Price
-20,000 €
How much has each feature contributed to the
prediction compared to the average prediction
Park Contributed
+ 10k
Cats Contributed
-50k
Secure
Neighbourhood
Contributed
+ 30k
Paint Contributed
-10k
Shapley Additive Explanations(SHAP)
For the model agnostic explainer, SHAP leverages Shapley values from Game Theory.
To get the importance of feature X{i}:
● Get all subsets of features S that do not contain X{i}
● Compute the effect on our predictions of adding X{i} to all
those subsets
● Aggregate all contributions to compute marginal contribution
of the feature
Shapley Additive Explanations
(SHAP)
● TreeExplainer - For tree based models . Works with scikit-
learn, xgboost, lightgbm, catboost
● DeepExplainer - For Deep Learning models
● KernelExplainer - Model agnostic explainer
SHAP - Local Interpretation
● Base value is the expected value of your model
● Output value is what your model predicted for this observation
● In red are the positive SHAP values, the features that contribute positively to the
outcome
● In blue the negative SHAP values, features that contribute negatively to the
outcome
SHAP - Global Interpretation
Although SHAP values are local, by plotting all of them at once we can learn a
lot about our model globally
SHAP-TreeExplainerAPI
1. Create a new explainer, with our model as argument
explainer = TreeExplainer(my_tree_model)
2. Calculate shap_values from our model using some observations
shap_values = explainer.shap_values(observations)
3. Use SHAP visualisation functions with our shap_values
shap.force_plot(base_value, shap_values[0]) # local explanation
shap.summary_plot(shap_values) # Global features importance
Microsoft IntepretML
Glassbox -
Models
Blackbox
Explanations
Interpredibility Approaches
https://github.com/interpretml/interpret
Glassbox – Models
Models designed to be interpretable.
Lossesless explainablity .
Linear Regression
Decision Models
Rule Lists
Explainable Boosting Machines
(EBM)
……..
Explainable Boosting Machines (EBM)
1. EBM preserves interpredibulty of a linear
model
2. Matches Accuracy of powerfull blackbox
models – Xgboost , Random Forest
3. Light in deployment
4. Slow in fitting on data
from interpret.glassbox import *
from interpret import show
ebm =ExplainableBoostingClassifier()
ebm.fit(X_train, y_train)
ebm_global = ebm.explain_global() show(ebm_global)
ebm_local = ebm.explain_local(X_test[:5], y_test[:5],
show(ebm_local)
Blackbox – Explanations
Model
Perturb
Inputs
Analyse
Explanations
SHAP
LIME
Partial Dependence
Senstive Analysis
Questions. ?

More Related Content

What's hot

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
Aditya Bhattacharya
 
Achieving Algorithmic Transparency with Shapley Additive Explanations (H2O Lo...
Achieving Algorithmic Transparency with Shapley Additive Explanations (H2O Lo...Achieving Algorithmic Transparency with Shapley Additive Explanations (H2O Lo...
Achieving Algorithmic Transparency with Shapley Additive Explanations (H2O Lo...
Sri Ambati
 
Explainable AI
Explainable AIExplainable AI
Explainable AI
Wagston Staehler
 
Explainability and bias in AI
Explainability and bias in AIExplainability and bias in AI
Explainability and bias in AI
Bill Liu
 
DC02. Interpretation of predictions
DC02. Interpretation of predictionsDC02. Interpretation of predictions
DC02. Interpretation of predictions
Anton Kulesh
 
CounterFactual Explanations.pdf
CounterFactual Explanations.pdfCounterFactual Explanations.pdf
CounterFactual Explanations.pdf
Bong-Ho Lee
 
Explainable AI (XAI) - A Perspective
Explainable AI (XAI) - A Perspective Explainable AI (XAI) - A Perspective
Explainable AI (XAI) - A Perspective
Saurabh Kaushik
 
Ensemble learning
Ensemble learningEnsemble learning
Ensemble learning
Haris Jamil
 
Lecture 18: Gaussian Mixture Models and Expectation Maximization
Lecture 18: Gaussian Mixture Models and Expectation MaximizationLecture 18: Gaussian Mixture Models and Expectation Maximization
Lecture 18: Gaussian Mixture Models and Expectation Maximizationbutest
 
Towards Human-Centered Machine Learning
Towards Human-Centered Machine LearningTowards Human-Centered Machine Learning
Towards Human-Centered Machine Learning
Sri Ambati
 
Using SHAP to Understand Black Box Models
Using SHAP to Understand Black Box ModelsUsing SHAP to Understand Black Box Models
Using SHAP to Understand Black Box Models
Jonathan Bechtel
 
Prepare your data for machine learning
Prepare your data for machine learningPrepare your data for machine learning
Prepare your data for machine learning
Ivo Andreev
 
Data Science - Part V - Decision Trees & Random Forests
Data Science - Part V - Decision Trees & Random Forests Data Science - Part V - Decision Trees & Random Forests
Data Science - Part V - Decision Trees & Random Forests
Derek Kane
 
Automated Machine Learning (Auto ML)
Automated Machine Learning (Auto ML)Automated Machine Learning (Auto ML)
Automated Machine Learning (Auto ML)
Hayim Makabee
 
Cure, Clustering Algorithm
Cure, Clustering AlgorithmCure, Clustering Algorithm
Cure, Clustering Algorithm
Lino Possamai
 
Feature Engineering in Machine Learning
Feature Engineering in Machine LearningFeature Engineering in Machine Learning
Feature Engineering in Machine Learning
Knoldus Inc.
 
Interpretable machine learning
Interpretable machine learningInterpretable machine learning
Interpretable machine learning
Sri Ambati
 
Overfitting & Underfitting
Overfitting & UnderfittingOverfitting & Underfitting
Overfitting & Underfitting
SOUMIT KAR
 
Interpretability of machine learning
Interpretability of machine learningInterpretability of machine learning
Interpretability of machine learning
Daiki Tanaka
 
Model selection and cross validation techniques
Model selection and cross validation techniquesModel selection and cross validation techniques
Model selection and cross validation techniques
Venkata Reddy Konasani
 

What's hot (20)

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
 
Achieving Algorithmic Transparency with Shapley Additive Explanations (H2O Lo...
Achieving Algorithmic Transparency with Shapley Additive Explanations (H2O Lo...Achieving Algorithmic Transparency with Shapley Additive Explanations (H2O Lo...
Achieving Algorithmic Transparency with Shapley Additive Explanations (H2O Lo...
 
Explainable AI
Explainable AIExplainable AI
Explainable AI
 
Explainability and bias in AI
Explainability and bias in AIExplainability and bias in AI
Explainability and bias in AI
 
DC02. Interpretation of predictions
DC02. Interpretation of predictionsDC02. Interpretation of predictions
DC02. Interpretation of predictions
 
CounterFactual Explanations.pdf
CounterFactual Explanations.pdfCounterFactual Explanations.pdf
CounterFactual Explanations.pdf
 
Explainable AI (XAI) - A Perspective
Explainable AI (XAI) - A Perspective Explainable AI (XAI) - A Perspective
Explainable AI (XAI) - A Perspective
 
Ensemble learning
Ensemble learningEnsemble learning
Ensemble learning
 
Lecture 18: Gaussian Mixture Models and Expectation Maximization
Lecture 18: Gaussian Mixture Models and Expectation MaximizationLecture 18: Gaussian Mixture Models and Expectation Maximization
Lecture 18: Gaussian Mixture Models and Expectation Maximization
 
Towards Human-Centered Machine Learning
Towards Human-Centered Machine LearningTowards Human-Centered Machine Learning
Towards Human-Centered Machine Learning
 
Using SHAP to Understand Black Box Models
Using SHAP to Understand Black Box ModelsUsing SHAP to Understand Black Box Models
Using SHAP to Understand Black Box Models
 
Prepare your data for machine learning
Prepare your data for machine learningPrepare your data for machine learning
Prepare your data for machine learning
 
Data Science - Part V - Decision Trees & Random Forests
Data Science - Part V - Decision Trees & Random Forests Data Science - Part V - Decision Trees & Random Forests
Data Science - Part V - Decision Trees & Random Forests
 
Automated Machine Learning (Auto ML)
Automated Machine Learning (Auto ML)Automated Machine Learning (Auto ML)
Automated Machine Learning (Auto ML)
 
Cure, Clustering Algorithm
Cure, Clustering AlgorithmCure, Clustering Algorithm
Cure, Clustering Algorithm
 
Feature Engineering in Machine Learning
Feature Engineering in Machine LearningFeature Engineering in Machine Learning
Feature Engineering in Machine Learning
 
Interpretable machine learning
Interpretable machine learningInterpretable machine learning
Interpretable machine learning
 
Overfitting & Underfitting
Overfitting & UnderfittingOverfitting & Underfitting
Overfitting & Underfitting
 
Interpretability of machine learning
Interpretability of machine learningInterpretability of machine learning
Interpretability of machine learning
 
Model selection and cross validation techniques
Model selection and cross validation techniquesModel selection and cross validation techniques
Model selection and cross validation techniques
 

Similar to Interpretable ML

C3 w5
C3 w5C3 w5
A Unified Approach to Interpreting Model Predictions (SHAP)
A Unified Approach to Interpreting Model Predictions (SHAP)A Unified Approach to Interpreting Model Predictions (SHAP)
A Unified Approach to Interpreting Model Predictions (SHAP)
Rama Irsheidat
 
ML_in_QM_JC_02-10-18
ML_in_QM_JC_02-10-18ML_in_QM_JC_02-10-18
ML_in_QM_JC_02-10-18
Suzanne Wallace
 
Kaggle Days Paris - Alberto Danese - ML Interpretability
Kaggle Days Paris - Alberto Danese - ML InterpretabilityKaggle Days Paris - Alberto Danese - ML Interpretability
Kaggle Days Paris - Alberto Danese - ML Interpretability
Alberto Danese
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in Michelangelo
Alluxio, Inc.
 
Understanding Black Box Models with Shapley Values
Understanding Black Box Models with Shapley ValuesUnderstanding Black Box Models with Shapley Values
Understanding Black Box Models with Shapley Values
Jonathan Bechtel
 
VSSML17 Review. Summary Day 1 Sessions
VSSML17 Review. Summary Day 1 SessionsVSSML17 Review. Summary Day 1 Sessions
VSSML17 Review. Summary Day 1 Sessions
BigML, Inc
 
Shapley Tech Talk - SHAP and Shapley Discussion
Shapley Tech Talk - SHAP and Shapley DiscussionShapley Tech Talk - SHAP and Shapley Discussion
Shapley Tech Talk - SHAP and Shapley Discussion
Tushar Tank
 
Machine Learning and Deep Learning 4 dummies
Machine Learning and Deep Learning 4 dummies Machine Learning and Deep Learning 4 dummies
Machine Learning and Deep Learning 4 dummies
Dori Waldman
 
Machine learning4dummies
Machine learning4dummiesMachine learning4dummies
Machine learning4dummies
Michael Winer
 
The Power of Auto ML and How Does it Work
The Power of Auto ML and How Does it WorkThe Power of Auto ML and How Does it Work
The Power of Auto ML and How Does it Work
Ivo Andreev
 
Deep Learning Opening Workshop - Improving Generative Models - Junier Oliva, ...
Deep Learning Opening Workshop - Improving Generative Models - Junier Oliva, ...Deep Learning Opening Workshop - Improving Generative Models - Junier Oliva, ...
Deep Learning Opening Workshop - Improving Generative Models - Junier Oliva, ...
The Statistical and Applied Mathematical Sciences Institute
 
Explainability for Learning to Rank
Explainability for Learning to RankExplainability for Learning to Rank
Explainability for Learning to Rank
Sease
 
STAT7440StudentIMLPresentationJishan.pptx
STAT7440StudentIMLPresentationJishan.pptxSTAT7440StudentIMLPresentationJishan.pptx
STAT7440StudentIMLPresentationJishan.pptx
JishanAhmed24
 
Machine Learning in the Financial Industry
Machine Learning in the Financial IndustryMachine Learning in the Financial Industry
Machine Learning in the Financial Industry
Subrat Panda, PhD
 
BSSML16 L5. Summary Day 1 Sessions
BSSML16 L5. Summary Day 1 SessionsBSSML16 L5. Summary Day 1 Sessions
BSSML16 L5. Summary Day 1 Sessions
BigML, Inc
 
CSSC ML Workshop
CSSC ML WorkshopCSSC ML Workshop
CSSC ML Workshop
GDSC UofT Mississauga
 
Switch Transformers: Scaling to Trillion Parameter Models with Simple and Eff...
Switch Transformers: Scaling to Trillion Parameter Models with Simple and Eff...Switch Transformers: Scaling to Trillion Parameter Models with Simple and Eff...
Switch Transformers: Scaling to Trillion Parameter Models with Simple and Eff...
taeseon ryu
 
Steering Model Selection with Visual Diagnostics
Steering Model Selection with Visual DiagnosticsSteering Model Selection with Visual Diagnostics
Steering Model Selection with Visual Diagnostics
Melissa Moody
 
WIA 2019 - Steering Model Selection with Visual Diagnostics
WIA 2019 - Steering Model Selection with Visual DiagnosticsWIA 2019 - Steering Model Selection with Visual Diagnostics
WIA 2019 - Steering Model Selection with Visual Diagnostics
Women in Analytics Conference
 

Similar to Interpretable ML (20)

C3 w5
C3 w5C3 w5
C3 w5
 
A Unified Approach to Interpreting Model Predictions (SHAP)
A Unified Approach to Interpreting Model Predictions (SHAP)A Unified Approach to Interpreting Model Predictions (SHAP)
A Unified Approach to Interpreting Model Predictions (SHAP)
 
ML_in_QM_JC_02-10-18
ML_in_QM_JC_02-10-18ML_in_QM_JC_02-10-18
ML_in_QM_JC_02-10-18
 
Kaggle Days Paris - Alberto Danese - ML Interpretability
Kaggle Days Paris - Alberto Danese - ML InterpretabilityKaggle Days Paris - Alberto Danese - ML Interpretability
Kaggle Days Paris - Alberto Danese - ML Interpretability
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in Michelangelo
 
Understanding Black Box Models with Shapley Values
Understanding Black Box Models with Shapley ValuesUnderstanding Black Box Models with Shapley Values
Understanding Black Box Models with Shapley Values
 
VSSML17 Review. Summary Day 1 Sessions
VSSML17 Review. Summary Day 1 SessionsVSSML17 Review. Summary Day 1 Sessions
VSSML17 Review. Summary Day 1 Sessions
 
Shapley Tech Talk - SHAP and Shapley Discussion
Shapley Tech Talk - SHAP and Shapley DiscussionShapley Tech Talk - SHAP and Shapley Discussion
Shapley Tech Talk - SHAP and Shapley Discussion
 
Machine Learning and Deep Learning 4 dummies
Machine Learning and Deep Learning 4 dummies Machine Learning and Deep Learning 4 dummies
Machine Learning and Deep Learning 4 dummies
 
Machine learning4dummies
Machine learning4dummiesMachine learning4dummies
Machine learning4dummies
 
The Power of Auto ML and How Does it Work
The Power of Auto ML and How Does it WorkThe Power of Auto ML and How Does it Work
The Power of Auto ML and How Does it Work
 
Deep Learning Opening Workshop - Improving Generative Models - Junier Oliva, ...
Deep Learning Opening Workshop - Improving Generative Models - Junier Oliva, ...Deep Learning Opening Workshop - Improving Generative Models - Junier Oliva, ...
Deep Learning Opening Workshop - Improving Generative Models - Junier Oliva, ...
 
Explainability for Learning to Rank
Explainability for Learning to RankExplainability for Learning to Rank
Explainability for Learning to Rank
 
STAT7440StudentIMLPresentationJishan.pptx
STAT7440StudentIMLPresentationJishan.pptxSTAT7440StudentIMLPresentationJishan.pptx
STAT7440StudentIMLPresentationJishan.pptx
 
Machine Learning in the Financial Industry
Machine Learning in the Financial IndustryMachine Learning in the Financial Industry
Machine Learning in the Financial Industry
 
BSSML16 L5. Summary Day 1 Sessions
BSSML16 L5. Summary Day 1 SessionsBSSML16 L5. Summary Day 1 Sessions
BSSML16 L5. Summary Day 1 Sessions
 
CSSC ML Workshop
CSSC ML WorkshopCSSC ML Workshop
CSSC ML Workshop
 
Switch Transformers: Scaling to Trillion Parameter Models with Simple and Eff...
Switch Transformers: Scaling to Trillion Parameter Models with Simple and Eff...Switch Transformers: Scaling to Trillion Parameter Models with Simple and Eff...
Switch Transformers: Scaling to Trillion Parameter Models with Simple and Eff...
 
Steering Model Selection with Visual Diagnostics
Steering Model Selection with Visual DiagnosticsSteering Model Selection with Visual Diagnostics
Steering Model Selection with Visual Diagnostics
 
WIA 2019 - Steering Model Selection with Visual Diagnostics
WIA 2019 - Steering Model Selection with Visual DiagnosticsWIA 2019 - Steering Model Selection with Visual Diagnostics
WIA 2019 - Steering Model Selection with Visual Diagnostics
 

Recently uploaded

standardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghhstandardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghh
ArpitMalhotra16
 
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
pchutichetpong
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
haila53
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
axoqas
 
Q1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year ReboundQ1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year Rebound
Oppotus
 
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
ahzuo
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
TravisMalana
 
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
mbawufebxi
 
Empowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptxEmpowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptx
benishzehra469
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
jerlynmaetalle
 
一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单
ewymefz
 
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdfSample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
Linda486226
 
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
nscud
 
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
oz8q3jxlp
 
一比一原版(BU毕业证)波士顿大学毕业证成绩单
一比一原版(BU毕业证)波士顿大学毕业证成绩单一比一原版(BU毕业证)波士顿大学毕业证成绩单
一比一原版(BU毕业证)波士顿大学毕业证成绩单
ewymefz
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
u86oixdj
 
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
slg6lamcq
 
SOCRadar Germany 2024 Threat Landscape Report
SOCRadar Germany 2024 Threat Landscape ReportSOCRadar Germany 2024 Threat Landscape Report
SOCRadar Germany 2024 Threat Landscape Report
SOCRadar
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
slg6lamcq
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
balafet
 

Recently uploaded (20)

standardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghhstandardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghh
 
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
 
Q1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year ReboundQ1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year Rebound
 
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
 
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
 
Empowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptxEmpowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptx
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
 
一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单
 
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdfSample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
 
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
 
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
 
一比一原版(BU毕业证)波士顿大学毕业证成绩单
一比一原版(BU毕业证)波士顿大学毕业证成绩单一比一原版(BU毕业证)波士顿大学毕业证成绩单
一比一原版(BU毕业证)波士顿大学毕业证成绩单
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
 
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
 
SOCRadar Germany 2024 Threat Landscape Report
SOCRadar Germany 2024 Threat Landscape ReportSOCRadar Germany 2024 Threat Landscape Report
SOCRadar Germany 2024 Threat Landscape Report
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
 

Interpretable ML

  • 1. 1. Introduction - Why do we need Model Interpretability? 2. Eli5 and Permutation Importance 3. LIME - Local Interpretable Model agnostic Explanations 4. SHAP - Shapley Additive Explanation 5. Microsoft IntepretML Agenda
  • 2. Why interpretability is important Data Science algortihms are used to make lot of cirtical decisions in various industries • Credit Rating • Disease diagnonsis • Banks (Loan processing) • Recommendations (Products , movies) • Crime control
  • 3. Why interpretability is important ExplainDecisions Improve Models Strengthen Trust & Transparency Satisfy Regulatory Requirements
  • 4. Fairness & Transperability in ML Model Example : Predicting Employees performance in big company Input Data : Past perfromance reviews of the employees for the last 10 yrs Caveat : What if company promotes more Men than Women ? Output : Model will learn the bias and predict favourable result for Men Models are Opinions Embedded in Mathematics — Cathy O’Neil
  • 5.
  • 6. Some Models are easy to Interpret X1 X2 IF 5X1 + 2X2 > 0 OTHERWISE Savings Income X1 X2 X1 > 0.5 X2 > 0.5 Decision TreesLinear / Logistic Regression
  • 7. Some models are harder to interpret Ensemble models (random forest, boosting, etc…) 1. Hard to understand the role of each feature 2. Usually comes with feature importance 3. Doesn’t tell us if feature affects decision positively or negatively Deep Neural Networks 1. No correlation between the input layer & output 2. Black-box
  • 8. Should we use only simple model • Use simple models like Linear or Logessitic regressions , so that you can explain the results • Use complex models & use interpredicbility techinques to explain the res
  • 9. Types of Interpretations ● Local: Explain how and why a specific prediction was made ○ Why did our model predict certain outcome for given a given customer ● Global: Explain how our model works overall ○ What features are important for our model and how do they impact the prediction ? ○ Feature Importance provides amplitude , not direction of impact
  • 10. ELI5 & Permutation Importance • Can be used to interpret sklearn-like models • Works for both Regression & Classification models • Create nice visualisations for white-box models o Can be used for local and global interpretation • Implements Permutation Importance for black-box models (boosting) o Only global interpretation
  • 11. ELI5 – White-box Models Explain model globally (feature importance): import eli5 eli5.show_weights(model)
  • 12. ELI5 – White-box Models Explain model Locally import eli5 eli5.show_prediction(model, observation)
  • 13. ELI5 – Permutation Importance • Model Agnostic • Provides global interpretation • For each feature: o Shuffle values in the provided dataset o Generate predictions using the model on the modified dataset o Compute the decrease in accuracy vs before shuffling
  • 14. ELI5 – Permutation Importance perm = PermutationImportance(model) perm.fit(X, y) eli5.show_weights(perm)
  • 15. LIME - Local Interpretable Model-Agnostic Explanations Local: Explains why a single data point was classified as a specific class Model-agnostic: Treats the model as a black-box. Doesn’t need to know how it makes predictions Paper “Why should I trust you?” published in August 2016. "Why Should I Trust You?": Explaining the Predictions of Any Classifier Marco Tulio Ribeiro, Sameer Singh, Carlos Guestrin
  • 16. Being Model Agnostic No assumptions about the internal structure… X1 >0.5 f Explain any existing, or future, model Data Decision F(x )
  • 17. Being Local & Model-Agnostic Source: https://www.youtube.com/watch?v=LAm4QmVaf0E&t=3658s “Global” explanation is too complicated
  • 18. Being Local & Model-Agnostic Source: https://www.youtube.com/watch?v=LAm4QmVaf0E&t=3658s “Global” explanation is too complicated
  • 19. Being Local & Model-Agnostic Source: https://www.youtube.com/watch?v=LAm4QmVaf0E&t=3658s “Global” explanation is too complicated Explanation is an interpretable model, that is locally accurate
  • 20. LIME - How does it work? "Why Should I Trust You?": Explaining the Predictions of Any Classifier Marco Tulio Ribeiro, Sameer Singh, Carlos Guestrin
  • 21. How LIME Works 1. Permute data -Create new dataset around observation by sampling from distribution learnt on training data (In the Perturbed dataset for Numerical features are picked based on the distribution & categorical values based on the occurrence) 2. Calculate distance between permutations and original observations 3. Use model to predict probability on new points, that’s our new y 4. Pick m features best describing the complex model outcome from the permuted data 5. Fit a linear model on data in m dimensions weighted by similarity
  • 22. ● Central plot shows importance of the top features for this prediction ○ Value corresponds to the weight of the linear model ○ Direction corresponds to whether it pushes in one way or the other ● Numerical features are discretized into bins ○ Easier to interpret: weight == contribution / sign of weight == direction How LIME Works
  • 23. "Why Should I Trust You?": Explaining the Predictions of Any Classifier Marco Tulio Ribeiro, Sameer Singh, Carlos Guestrin LIME - Canbe used on images
  • 24. Lime supports many types of data: ● Tabular Explainer ● Recurrent Tabular Explainer ● Image Explainer ● Text Explainer LIME Available Explainers
  • 25. Shapley Additive Explanations(SHAP) ● Anexplanation model is a simpler model that is a good approximation of our complex model. ● “Additive feature attribution methods”: the local explanation is a linear combination of the features. Dataset Complex Model Prediction Explainer Explanation
  • 26. ShapleyAdditive Explanations(SHAP) ● For a given observation, we compute a SHAP value per feature, such that: sum(SHAP_values_for_obs) = prediction_for_obs - model_expected_value ● Model’s expected value is the average prediction made by our model
  • 27. How much has each feature contributed to the prediction compared to the average prediction House price Prediction 400,000 € Average house price prediction for all the apartments 420,000 € Delta in Price -20,000 €
  • 28. How much has each feature contributed to the prediction compared to the average prediction Park Contributed + 10k Cats Contributed -50k Secure Neighbourhood Contributed + 30k Paint Contributed -10k
  • 29. Shapley Additive Explanations(SHAP) For the model agnostic explainer, SHAP leverages Shapley values from Game Theory. To get the importance of feature X{i}: ● Get all subsets of features S that do not contain X{i} ● Compute the effect on our predictions of adding X{i} to all those subsets ● Aggregate all contributions to compute marginal contribution of the feature
  • 30. Shapley Additive Explanations (SHAP) ● TreeExplainer - For tree based models . Works with scikit- learn, xgboost, lightgbm, catboost ● DeepExplainer - For Deep Learning models ● KernelExplainer - Model agnostic explainer
  • 31. SHAP - Local Interpretation ● Base value is the expected value of your model ● Output value is what your model predicted for this observation ● In red are the positive SHAP values, the features that contribute positively to the outcome ● In blue the negative SHAP values, features that contribute negatively to the outcome
  • 32. SHAP - Global Interpretation Although SHAP values are local, by plotting all of them at once we can learn a lot about our model globally
  • 33. SHAP-TreeExplainerAPI 1. Create a new explainer, with our model as argument explainer = TreeExplainer(my_tree_model) 2. Calculate shap_values from our model using some observations shap_values = explainer.shap_values(observations) 3. Use SHAP visualisation functions with our shap_values shap.force_plot(base_value, shap_values[0]) # local explanation shap.summary_plot(shap_values) # Global features importance
  • 34. Microsoft IntepretML Glassbox - Models Blackbox Explanations Interpredibility Approaches https://github.com/interpretml/interpret
  • 35. Glassbox – Models Models designed to be interpretable. Lossesless explainablity . Linear Regression Decision Models Rule Lists Explainable Boosting Machines (EBM) ……..
  • 36. Explainable Boosting Machines (EBM) 1. EBM preserves interpredibulty of a linear model 2. Matches Accuracy of powerfull blackbox models – Xgboost , Random Forest 3. Light in deployment 4. Slow in fitting on data from interpret.glassbox import * from interpret import show ebm =ExplainableBoostingClassifier() ebm.fit(X_train, y_train) ebm_global = ebm.explain_global() show(ebm_global) ebm_local = ebm.explain_local(X_test[:5], y_test[:5], show(ebm_local)