SlideShare a Scribd company logo
Machine Learning
Explainability
“Many people say machine learning models are "black boxes", in the sense that they
can make good predictions but you can't understand the logic behind those
predictions.”
Reference:
https://www.kaggle.com/code/dansbecker/use-cases-for-model-insights
Insights gained:
● What features in the data did the model think are most important?
● For any single prediction from a model, how did each feature in the data affect that particular
prediction?
● How does each feature affect the model's predictions in a big-picture sense (what is its
typical effect when considered over a large number of possible predictions)?
Why do we need to know the logic behind predictions?
1. Helps debugging
2. Informing Feature Engineering
3. Directing Future Data Collection
4. Informing Human Decision-Making
5. Building Trust
- Finds which features have the biggest impact on predictions
- Measures feature importance
Permutation Importance
Method:
1. Get a trained model
2. Randomly shuffle a single feature column and make predictions
3. Compute how much loss function suffered from shuffling
4. Undo shuffle and repeat for next feature column
Example:
We want to predict whether a soccer/football team will have the "Man of the
Game" winner based on the team's statistics.
Example Implementation:
We want to predict whether a soccer/football team will have the "Man of the Game"
winner based on the team's statistics.
The top values are the most important features, and those towards the
bottom matter least.
Partial Dependence Plots
- Shows how a feature affects predictions
- Can be interpreted similarly to the coefficients in those
models.
Method:
1. Get a trained model
2. Start with one single row of data
3. Alter the value of one feature starting from low values to high values
and make predictions
4. Repeat for very row and compute average predictions for every value of
the feature (from low to high)
Example Implementation:
Need to
specify which
feature to
plot
Y-axis→ change in prediction
from baseline (when feature
value=0)
X-axis → feature value
Blue region→ confidence
interval
Interpretation→ scoring one
goal substantially increases
your chances of winning "Man
of The Match." But extra goals
beyond that appear to have little
impact on predictions.
Interpretation→
This model thinks you are
more likely to win Man of the
Match if your players run a
total of 100 km over the
course of the game. Though
running much more causes
lower predictions.
2D Partial Dependence Plots
- Shows how the interaction between feature affects predictions
Description→ shows predictions for any
combination of Goals Scored and Distance
covered.
Lighter color indicates higher probability for
winning.
Interpretation→ High change to win when
a team scores at least 1 goal and they run a
total distance close to 100km.
If they score 0 goals, distance covered
doesn't matter.
SHAP Values (SHapley Additive exPlanations)
- Breaks down a prediction to show the impact of each feature leading to that particular
prediction.
- Useful for justifying the model’s reason for prediction
- Example: A model says a bank shouldn't loan someone money, and the bank is legally
required to explain the basis for each loan rejection
Method:
1. Get a trained model
2. Make prediction for a specific row of data
3. Decomposes a prediction with the following equation:
sum(SHAP values for all features) = pred_for_team -
pred_for_baseline_values
The SHAP values of all features sum up to explain why the prediction was different from the baseline.
Example Implementation:
Decomposes a prediction in a graph like this.
Interpretation
- We predicted 0.71, whereas the base_value is 0.4933.
- Feature values causing increased predictions are in pink, and also shows the magnitude of the
feature's effect. The biggest impact comes from Goal Scored being 2.
- Feature values decreasing the prediction are in blue.
Advanced Uses of SHAP Values
SHAP summary plots: Give us a birds-eye view of feature importance and what is driving it.
Each dot has three characteristics:
- Vertical axis indicates what feature it is
depicting
- Color indicates high or low value of the
feature for that row of the dataset
- Horizontal axis shows whether the effect
of that value caused a higher or lower
prediction.
The point in the upper left was for a team
that scored few goals, reducing the
prediction by 0.25.
Interpretation:
Usually Yellow Card doesn't affect the
prediction, but there is an extreme case
where a high value caused a much lower
prediction.
Thank You
Any Questions ?

More Related Content

Similar to Machine Learning Explainability.pptx

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
 
Stock market analysis
Stock market analysisStock market analysis
Stock market analysis
Sruti Jain
 
Recovering 3D human body configurations using shape contexts
Recovering 3D human body configurations using shape contextsRecovering 3D human body configurations using shape contexts
Recovering 3D human body configurations using shape contexts
wolf
 
Machine Learning.pptx
Machine Learning.pptxMachine Learning.pptx
Machine Learning.pptx
NitinSharma134320
 
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
 
Machine Learning in e commerce - Reboot
Machine Learning in e commerce - RebootMachine Learning in e commerce - Reboot
Machine Learning in e commerce - Reboot
Marion DE SOUSA
 
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
 
Interpretable ML
Interpretable MLInterpretable ML
Interpretable ML
Mayur Sand
 
Dive into Machine Learning Event MUGDSC.pptx
Dive into Machine Learning Event MUGDSC.pptxDive into Machine Learning Event MUGDSC.pptx
Dive into Machine Learning Event MUGDSC.pptx
RakshaAgrawal21
 
Dive into Machine Learning Event--MUGDSC
Dive into Machine Learning Event--MUGDSCDive into Machine Learning Event--MUGDSC
Dive into Machine Learning Event--MUGDSC
RakshaAgrawal21
 
Unveiling the Market: Predicting House Prices with Data Science
Unveiling the Market: Predicting House Prices with Data ScienceUnveiling the Market: Predicting House Prices with Data Science
Unveiling the Market: Predicting House Prices with Data Science
Boston Institute of Analytics
 
Predicting House Prices: A Machine Learning Approach
Predicting House Prices: A Machine Learning ApproachPredicting House Prices: A Machine Learning Approach
Predicting House Prices: A Machine Learning Approach
Boston Institute of Analytics
 
laptop price prediction presentation
laptop price prediction presentationlaptop price prediction presentation
laptop price prediction presentation
NeerajNishad4
 
Stock Market Prediction using Machine Learning
Stock Market Prediction using Machine LearningStock Market Prediction using Machine Learning
Stock Market Prediction using Machine Learning
Aravind Balaji
 
Copy of CRICKET MATCH WIN PREDICTOR USING LOGISTIC ...
Copy of CRICKET MATCH WIN PREDICTOR USING LOGISTIC                           ...Copy of CRICKET MATCH WIN PREDICTOR USING LOGISTIC                           ...
Copy of CRICKET MATCH WIN PREDICTOR USING LOGISTIC ...
PATHALAMRAJESH
 
FAA Flight Landing Distance Forecasting and Analysis
FAA Flight Landing Distance Forecasting and AnalysisFAA Flight Landing Distance Forecasting and Analysis
FAA Flight Landing Distance Forecasting and Analysis
Quynh Tran
 
House price prediction
House price predictionHouse price prediction
House price prediction
SabahBegum
 
pre
prepre
pre
Gang Wu
 
Instruction level parallelism using ppm branch prediction
Instruction level parallelism using ppm branch predictionInstruction level parallelism using ppm branch prediction
Instruction level parallelism using ppm branch prediction
IAEME Publication
 
housepriceprediction-180915174356.pdf
housepriceprediction-180915174356.pdfhousepriceprediction-180915174356.pdf
housepriceprediction-180915174356.pdf
VinayShekarReddy
 

Similar to Machine Learning Explainability.pptx (20)

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
 
Stock market analysis
Stock market analysisStock market analysis
Stock market analysis
 
Recovering 3D human body configurations using shape contexts
Recovering 3D human body configurations using shape contextsRecovering 3D human body configurations using shape contexts
Recovering 3D human body configurations using shape contexts
 
Machine Learning.pptx
Machine Learning.pptxMachine Learning.pptx
Machine Learning.pptx
 
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
 
Machine Learning in e commerce - Reboot
Machine Learning in e commerce - RebootMachine Learning in e commerce - Reboot
Machine Learning in e commerce - Reboot
 
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)
 
Interpretable ML
Interpretable MLInterpretable ML
Interpretable ML
 
Dive into Machine Learning Event MUGDSC.pptx
Dive into Machine Learning Event MUGDSC.pptxDive into Machine Learning Event MUGDSC.pptx
Dive into Machine Learning Event MUGDSC.pptx
 
Dive into Machine Learning Event--MUGDSC
Dive into Machine Learning Event--MUGDSCDive into Machine Learning Event--MUGDSC
Dive into Machine Learning Event--MUGDSC
 
Unveiling the Market: Predicting House Prices with Data Science
Unveiling the Market: Predicting House Prices with Data ScienceUnveiling the Market: Predicting House Prices with Data Science
Unveiling the Market: Predicting House Prices with Data Science
 
Predicting House Prices: A Machine Learning Approach
Predicting House Prices: A Machine Learning ApproachPredicting House Prices: A Machine Learning Approach
Predicting House Prices: A Machine Learning Approach
 
laptop price prediction presentation
laptop price prediction presentationlaptop price prediction presentation
laptop price prediction presentation
 
Stock Market Prediction using Machine Learning
Stock Market Prediction using Machine LearningStock Market Prediction using Machine Learning
Stock Market Prediction using Machine Learning
 
Copy of CRICKET MATCH WIN PREDICTOR USING LOGISTIC ...
Copy of CRICKET MATCH WIN PREDICTOR USING LOGISTIC                           ...Copy of CRICKET MATCH WIN PREDICTOR USING LOGISTIC                           ...
Copy of CRICKET MATCH WIN PREDICTOR USING LOGISTIC ...
 
FAA Flight Landing Distance Forecasting and Analysis
FAA Flight Landing Distance Forecasting and AnalysisFAA Flight Landing Distance Forecasting and Analysis
FAA Flight Landing Distance Forecasting and Analysis
 
House price prediction
House price predictionHouse price prediction
House price prediction
 
pre
prepre
pre
 
Instruction level parallelism using ppm branch prediction
Instruction level parallelism using ppm branch predictionInstruction level parallelism using ppm branch prediction
Instruction level parallelism using ppm branch prediction
 
housepriceprediction-180915174356.pdf
housepriceprediction-180915174356.pdfhousepriceprediction-180915174356.pdf
housepriceprediction-180915174356.pdf
 

Recently uploaded

一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
bopyb
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
Social Samosa
 
Natural Language Processing (NLP), RAG and its applications .pptx
Natural Language Processing (NLP), RAG and its applications .pptxNatural Language Processing (NLP), RAG and its applications .pptx
Natural Language Processing (NLP), RAG and its applications .pptx
fkyes25
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
sameer shah
 
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
mzpolocfi
 
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
dwreak4tg
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
roli9797
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
74nqk8xf
 
State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023
kuntobimo2016
 
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
slg6lamcq
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging DataPredictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Kiwi Creative
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
Social Samosa
 
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
v3tuleee
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
Walaa Eldin Moustafa
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
jerlynmaetalle
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
slg6lamcq
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
aqzctr7x
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Aggregage
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
manishkhaire30
 

Recently uploaded (20)

一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
 
Natural Language Processing (NLP), RAG and its applications .pptx
Natural Language Processing (NLP), RAG and its applications .pptxNatural Language Processing (NLP), RAG and its applications .pptx
Natural Language Processing (NLP), RAG and its applications .pptx
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
 
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
 
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
 
State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023
 
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging DataPredictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
 
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
 

Machine Learning Explainability.pptx

  • 1. Machine Learning Explainability “Many people say machine learning models are "black boxes", in the sense that they can make good predictions but you can't understand the logic behind those predictions.” Reference: https://www.kaggle.com/code/dansbecker/use-cases-for-model-insights
  • 2. Insights gained: ● What features in the data did the model think are most important? ● For any single prediction from a model, how did each feature in the data affect that particular prediction? ● How does each feature affect the model's predictions in a big-picture sense (what is its typical effect when considered over a large number of possible predictions)?
  • 3. Why do we need to know the logic behind predictions? 1. Helps debugging 2. Informing Feature Engineering 3. Directing Future Data Collection 4. Informing Human Decision-Making 5. Building Trust
  • 4. - Finds which features have the biggest impact on predictions - Measures feature importance Permutation Importance Method: 1. Get a trained model 2. Randomly shuffle a single feature column and make predictions 3. Compute how much loss function suffered from shuffling 4. Undo shuffle and repeat for next feature column
  • 5. Example: We want to predict whether a soccer/football team will have the "Man of the Game" winner based on the team's statistics.
  • 6. Example Implementation: We want to predict whether a soccer/football team will have the "Man of the Game" winner based on the team's statistics. The top values are the most important features, and those towards the bottom matter least.
  • 7. Partial Dependence Plots - Shows how a feature affects predictions - Can be interpreted similarly to the coefficients in those models. Method: 1. Get a trained model 2. Start with one single row of data 3. Alter the value of one feature starting from low values to high values and make predictions 4. Repeat for very row and compute average predictions for every value of the feature (from low to high)
  • 9. Y-axis→ change in prediction from baseline (when feature value=0) X-axis → feature value Blue region→ confidence interval Interpretation→ scoring one goal substantially increases your chances of winning "Man of The Match." But extra goals beyond that appear to have little impact on predictions.
  • 10. Interpretation→ This model thinks you are more likely to win Man of the Match if your players run a total of 100 km over the course of the game. Though running much more causes lower predictions.
  • 11. 2D Partial Dependence Plots - Shows how the interaction between feature affects predictions
  • 12. Description→ shows predictions for any combination of Goals Scored and Distance covered. Lighter color indicates higher probability for winning. Interpretation→ High change to win when a team scores at least 1 goal and they run a total distance close to 100km. If they score 0 goals, distance covered doesn't matter.
  • 13. SHAP Values (SHapley Additive exPlanations) - Breaks down a prediction to show the impact of each feature leading to that particular prediction. - Useful for justifying the model’s reason for prediction - Example: A model says a bank shouldn't loan someone money, and the bank is legally required to explain the basis for each loan rejection Method: 1. Get a trained model 2. Make prediction for a specific row of data 3. Decomposes a prediction with the following equation: sum(SHAP values for all features) = pred_for_team - pred_for_baseline_values The SHAP values of all features sum up to explain why the prediction was different from the baseline.
  • 15. Decomposes a prediction in a graph like this. Interpretation - We predicted 0.71, whereas the base_value is 0.4933. - Feature values causing increased predictions are in pink, and also shows the magnitude of the feature's effect. The biggest impact comes from Goal Scored being 2. - Feature values decreasing the prediction are in blue.
  • 16. Advanced Uses of SHAP Values SHAP summary plots: Give us a birds-eye view of feature importance and what is driving it. Each dot has three characteristics: - Vertical axis indicates what feature it is depicting - Color indicates high or low value of the feature for that row of the dataset - Horizontal axis shows whether the effect of that value caused a higher or lower prediction.
  • 17. The point in the upper left was for a team that scored few goals, reducing the prediction by 0.25. Interpretation: Usually Yellow Card doesn't affect the prediction, but there is an extreme case where a high value caused a much lower prediction.

Editor's Notes

  1. I learnt about it recently from a course in Kaggle It is about using statistical packages in python to help us understand the logic, the model used to make predictions
  2. Understanding the patterns a model is finding will help you identify when those are at odds with your knowledge of the real world, and this is typically the first step in tracking down bugs. Helps you understand feature importance and feature correlation to help you perform feature engineering (create new features from existing ones). Especially helpful when number of features are large. The insights can help you understand the value of features you currently have, which will help you reason about what new values may be most helpful for future data collection. Sometimes insights about what lead to the prediction can be more important than the value of prediction for future decision making strategies. showing insights that fit our general understanding of the problem will help build trust, even among people with little deep knowledge of data science
  3. Diasvantage: But it doesn't tell you how each features matter. If a feature has medium permutation importance, that could mean it has a large effect for a few predictions, but no effect in general, or a medium effect for all predictions.
  4. The randomness to the exact performance change is measured by shuffling same column multiple times and measuring the variance in change in performance. Negative values: When by chance prediction after shuffling is better. Indicates the feature is unimportant. You'll occasionally see negative values for permutation importances. In those cases, the predictions on the shuffled (or noisy) data happened to be more accurate than the real data. This happens when the feature didn't matter (should have had an importance close to 0), but random chance caused the predictions on shuffled data to be more accurate. This is more common with small datasets, like the one in this example, because there is more room for luck/chance.
  5. The randomness to the exact performance change is measured by shuffling same column multiple times and measuring the variance in change in performance. Negative values: When by chance prediction after shuffling is better. Indicates the feature is unimportant. You'll occasionally see negative values for permutation importances. In those cases, the predictions on the shuffled (or noisy) data happened to be more accurate than the real data. This happens when the feature didn't matter (should have had an importance close to 0), but random chance caused the predictions on shuffled data to be more accurate. This is more common with small datasets, like the one in this example, because there is more room for luck/chance.
  6. (Model: RandomForest)
  7. SHAP values interpret the impact of having a certain value for a given feature in comparison to the prediction we'd make if that feature took some baseline value. How much was a prediction driven by the fact that the team scored 3 goals, instead of some baseline number of goals.
  8. Can use other shap objects for specific models such as: shap.DeepExplainer works with Deep Learning models.
  9. Interpretation: For example, the point in the upper left was for a team that scored few goals, reducing the prediction by 0.25. Usually Yellow Card doesn't affect the prediction, but there is an extreme case where a high value caused a much lower prediction. Permutation Importance doesn't tell us how each features matter. If a feature has medium permutation importance, that could mean it has a large effect for a few predictions, but no effect in general, or a medium effect for all predictions.