SlideShare a Scribd company logo
1 of 18
Download to read offline
BH Lee
Counterfactual Explanation
Interpretable Machine Learning
Counterfactual Explanations
• A counterfactual explanation describes a causal situation in the form: “If X had
not occurred, Y would not have occurred”

• In interpretable machine learning, counterfactual explanations can be used to
explain predictions of individual instances

• A counterfactual explanation of a prediction describes the smallest change to
the feature values that changes the prediction to a prede
fi
ned output.

• Counterfactuals are human-friendly explanations, because they are
contrastive to the current instance and because they are selective, meaning they
usually focus on a small number of feature changes. But counterfactuals su
ff
er
from the ‘Rashomon e
ff
ect’. 
What Is a Good Explanation?
• Explanations are contrastive. → Humans do not want a complete explanation for a
prediction, but want to compare what the di
ff
erences were to another instance’s
prediction.

• Explanations are selected. → Make the explanation very short, give only 1 to 3
reasons, even if the world is more complex.

• Explanations are social. → Pay attention to the social environment of your machine
learning application and the target audience.

• Explanations focus on the abnormal. If one of the input features for a prediction was
abnormal in any sense (like a rare category of a categorical feature) and the feature
in
fl
uenced the prediction, it should be included in an explanation, even if other
‘normal’ features have the same in
fl
uence on the prediction as the abnormal one.
https://brunch.co.kr/@bdh/33
What is a good counterfactual explanation?
• A counterfactual instance produces the prede
fi
ned prediction as closely as
possible.

• A counterfactual should be as similar as possible to the instance regarding
feature values.

• Multiple diverse counterfactual explanation

• A counterfactual instance should have feature values that are likely.
What is a good counterfactual explanation?
Generating Counterfactual Explanations
Method by Wachter et al
• Objective Function: , 

• A higher value of λ means that we prefer counterfactuals with predictions close to the desired
outcome y’

• Manhattan distance weighted with the inverse median absolute deviation (MAD) of each feature

•
Total distance is the sum of all p feature-wise distances: 

• → It is the equivalent of the variance of
a feature(more robust to outliers than Euclidian distance)

• Instead of λ, the author suggest to use
arg min
x′

max
λ
L(x, x′

, y′

, λ) L(x, x′

, y′

, λ) = λ ⋅ ( ̂
f(x′

) − y′

)2
+ d(x, x′

)
d(x, x′

) =
p
∑
j=1
|xj − x′

j |
MADj
MADj = mediani∈{1,…,n}(|xi,j − medianl∈{1,…,n}(xl,j)|)
ϵ(Tolerance) : | ̂
f(x′

) − y′

| ≤ ϵ
Generating Counterfactual Explanations(Cont.d)
Method by Wachter et al
• Process

• Select an instance x to be explained, the desired outcome y’, a tolerance ϵ and a (low) initial value for λ

• Sample a random instance as initial counterfactual.

• Optimize the loss with the initially sampled counterfactual as starting point.

• While 

• Increase 

• Optimize the loss with the current counterfactual as starting point. 

• Return the counterfactual that minimizes the loss. 

• Repeat steps 2-4 and return the list of counterfactuals or the one that minimizes the loss.
| ̂
f(x′

) − y′

| > ϵ
λ
Generating Counterfactual Explanations(Cont.d)
Method by Wachter et al
• It only takes the
fi
rst and second criteria into account not the last two
(“produce counterfactuals with only a few feature changes and likely feature
values”).

• The method does not handle categorical features with many di
ff
erent levels
well.

• The authors of the method suggested running the method separately for each
combination of feature values of the categorical features → High computation
cost
Generating Counterfactual Explanations(Cont.d)
Method by Dandl et al
• Loss Function: 

• Multi Objective Function: 

•
, , 

, 

•
Gowel’s Distance: 

• : The observed value range, scales for all features is between 0 and 1
L(x, x′

, y′

, Xobs
) = (o1( ̂
f(x′

), y′

), o2(x, x′

), o3(x, x′

), o4(x′

, Xobs
))
o1( ^
f(x′

), y′

) =
0 if 
^
f(x′

) ∈ y′

inf
y′

∈y′

| ^
f(x′

) − y′

| else
o2(x, x′

) =
1
p
p
∑
j=1
δG(xj, x′

j)
o3(x, x′

) = ||x − x′

||0 =
p
∑
j=1
𝕀
x′

j≠xj
o4(x′

, Xobs) =
1
p
p
∑
j=1
δG(x′

j, x[1]
j
)
δG(xj, x′

j) =
1
^
Rj
|xj − x′

j | if xj numerical
𝕀
xj≠x′

j
if xj categorical
̂
R j δG
Generating Counterfactual Explanations(Cont.d)
Method by Dandl et al
• NSGA-II: A method for solving multi-objective optimization problems by
fi
nding multiple Pareto solutions. (Especially,
using Nondominated Sorting, Crowding Distance)

• In the
fi
rst generation a group of counterfactual candidates is initialized by randomly changing some of the features
compared to our instance x to be explained.

• a candidate is then evaluated using the four objective functions of above. Among them, we randomly select some
candidates, where
fi
tter candidates are more likely to be selected.

• The nondominated sorting algorithm sorts the candidates according to their objective values. If candidates are
equally good, the crowding distance sorting algorithm sorts the candidates according to their diversity.
• A가 B에 대해서 모든 평가척도에서 우위를 가질 때 B is dominated 했다고 표현하고, Dominating Set을 파레토 최적해 집합이라
고 하고 파레토 최적해가 이루는 경계선을 Pareto front라고 한다. Pareto front와 거리가 가까을 수록 높은 순위가 부여됨

• Given the ranking of the two sorting algorithms, we select the most promising and/or most diverse half of the
candidates. We use this set for the next generation and start again with the selection, recombination and mutation
process. 

• Evaluation Metric: HyperVolume Parameter
Example
• Support vector machine (with radial basis kernel) to predict the probability
that a customer has a good credit risk.

• The goal is to
fi
nd counterfactual explanations for a customer with the
following feature values:

• The SVM predicts that the woman has a good credit risk with a probability of
24.2 %. The counterfactuals should answer how the input features need
to be changed to get a predicted probability larger than 50 %?
Example (Cont.d)
• The
fi
rst
fi
ve columns contain the proposed feature changes (only altered features are
displayed), the next three columns show the objective values 

• All counterfactuals have predicted probabilities greater than 50 % and do not dominate each
other. Non-dominated means that none of the counterfactuals has smaller values in all objectives
than the other counterfactuals.
Advantages
• The interpretation of counterfactual explanations is very clear. If the feature
values of an instance are changed according to the counterfactual, the
prediction changes to the prede
fi
ned prediction.

• The counterfactual method does not require access to the data or the
model. It only requires access to the model’s prediction function, which
would also work via a web API, for example.

• The method works also with systems that do not use machine learning.

• The counterfactual explanation method is relatively easy to implement.
Disadvantages
• For each instance you will usually
fi
nd multiple counterfactual explanations
(Rashomon e
ff
ect).
Bonus
Model Speci
fi
c CFE vs Model Agonistic CFE
Colab Link
Colab Practice
Thanks
Generating Counterfactual Explanations(Cont.d)
Method by Dandl et al
• NSGA-II: A method for solving multi-objective optimization problems by
fi
nding multiple Pareto solutions. (Especially, using Nondominated Sorting, Crowding Distance)

• A가 B에 대해서 모든 평가척도에서 우위를 가질 때 B is dominated 했다고 표현하고, Dominating Set을 파레토 최적해 집합이라고 하고 파레토 최적해들이 이루는 경계선을 파레토 경계
라고 한다. 다목적 최적화 알고리즘은 이 파레토 경계와 가까운 것을 기준으로 해들의 우수성을 평가한다.

• Nondominated Sorting Algorithm: 파레토 경계와 거리가 가까을 수록 높은 순위가 부여됨 → 지배되지 않은 해의 집합이 우선순위를 가지게 된다.

• Crowding Distance Sorting Algorithm: 유사하지 않을 수록 높은 Crowding Distance를 가짐 → 다양성에 높은 점수를 부여

• In the
fi
rst generation a group of counterfactual candidates is initialized by randomly changing some of the features compared to our instance x to be explained.

More Related Content

What's hot

Classification using back propagation algorithm
Classification using back propagation algorithmClassification using back propagation algorithm
Classification using back propagation algorithmKIRAN R
 
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...Simplilearn
 
Stuart russell and peter norvig artificial intelligence - a modern approach...
Stuart russell and peter norvig   artificial intelligence - a modern approach...Stuart russell and peter norvig   artificial intelligence - a modern approach...
Stuart russell and peter norvig artificial intelligence - a modern approach...Lê Anh Đạt
 
[Paper Reading] Attention is All You Need
[Paper Reading] Attention is All You Need[Paper Reading] Attention is All You Need
[Paper Reading] Attention is All You NeedDaiki Tanaka
 
Notes on attention mechanism
Notes on attention mechanismNotes on attention mechanism
Notes on attention mechanismKhang Pham
 
Neural network
Neural networkNeural network
Neural networkSilicon
 
Bias and variance trade off
Bias and variance trade offBias and variance trade off
Bias and variance trade offVARUN KUMAR
 
“An Introduction to Data Augmentation Techniques in ML Frameworks,” a Present...
“An Introduction to Data Augmentation Techniques in ML Frameworks,” a Present...“An Introduction to Data Augmentation Techniques in ML Frameworks,” a Present...
“An Introduction to Data Augmentation Techniques in ML Frameworks,” a Present...Edge AI and Vision Alliance
 
Deep Feed Forward Neural Networks and Regularization
Deep Feed Forward Neural Networks and RegularizationDeep Feed Forward Neural Networks and Regularization
Deep Feed Forward Neural Networks and RegularizationYan Xu
 
Chap 8. Optimization for training deep models
Chap 8. Optimization for training deep modelsChap 8. Optimization for training deep models
Chap 8. Optimization for training deep modelsYoung-Geun Choi
 
Linear regression
Linear regressionLinear regression
Linear regressionMartinHogg9
 
Autoencoders in Deep Learning
Autoencoders in Deep LearningAutoencoders in Deep Learning
Autoencoders in Deep Learningmilad abbasi
 
DISEASE PREDICTION SYSTEM USING DATA MINING
DISEASE PREDICTION SYSTEM USING  DATA MININGDISEASE PREDICTION SYSTEM USING  DATA MINING
DISEASE PREDICTION SYSTEM USING DATA MININGshivaniyadav112
 
Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceRamla Sheikh
 
Towards Human-Centered Machine Learning
Towards Human-Centered Machine LearningTowards Human-Centered Machine Learning
Towards Human-Centered Machine LearningSri Ambati
 
Renaissance@SNU 발표자료.pdf
Renaissance@SNU 발표자료.pdfRenaissance@SNU 발표자료.pdf
Renaissance@SNU 발표자료.pdfDoeunKim14
 
“How Transformers are Changing the Direction of Deep Learning Architectures,”...
“How Transformers are Changing the Direction of Deep Learning Architectures,”...“How Transformers are Changing the Direction of Deep Learning Architectures,”...
“How Transformers are Changing the Direction of Deep Learning Architectures,”...Edge AI and Vision Alliance
 

What's hot (20)

07 approximate inference in bn
07 approximate inference in bn07 approximate inference in bn
07 approximate inference in bn
 
Classification using back propagation algorithm
Classification using back propagation algorithmClassification using back propagation algorithm
Classification using back propagation algorithm
 
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
 
Stuart russell and peter norvig artificial intelligence - a modern approach...
Stuart russell and peter norvig   artificial intelligence - a modern approach...Stuart russell and peter norvig   artificial intelligence - a modern approach...
Stuart russell and peter norvig artificial intelligence - a modern approach...
 
[Paper Reading] Attention is All You Need
[Paper Reading] Attention is All You Need[Paper Reading] Attention is All You Need
[Paper Reading] Attention is All You Need
 
Notes on attention mechanism
Notes on attention mechanismNotes on attention mechanism
Notes on attention mechanism
 
Neural network
Neural networkNeural network
Neural network
 
Bias and variance trade off
Bias and variance trade offBias and variance trade off
Bias and variance trade off
 
“An Introduction to Data Augmentation Techniques in ML Frameworks,” a Present...
“An Introduction to Data Augmentation Techniques in ML Frameworks,” a Present...“An Introduction to Data Augmentation Techniques in ML Frameworks,” a Present...
“An Introduction to Data Augmentation Techniques in ML Frameworks,” a Present...
 
Deep Feed Forward Neural Networks and Regularization
Deep Feed Forward Neural Networks and RegularizationDeep Feed Forward Neural Networks and Regularization
Deep Feed Forward Neural Networks and Regularization
 
Chap 8. Optimization for training deep models
Chap 8. Optimization for training deep modelsChap 8. Optimization for training deep models
Chap 8. Optimization for training deep models
 
Linear regression
Linear regressionLinear regression
Linear regression
 
Autoencoders in Deep Learning
Autoencoders in Deep LearningAutoencoders in Deep Learning
Autoencoders in Deep Learning
 
DISEASE PREDICTION SYSTEM USING DATA MINING
DISEASE PREDICTION SYSTEM USING  DATA MININGDISEASE PREDICTION SYSTEM USING  DATA MINING
DISEASE PREDICTION SYSTEM USING DATA MINING
 
Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial Intelligence
 
Towards Human-Centered Machine Learning
Towards Human-Centered Machine LearningTowards Human-Centered Machine Learning
Towards Human-Centered Machine Learning
 
Renaissance@SNU 발표자료.pdf
Renaissance@SNU 발표자료.pdfRenaissance@SNU 발표자료.pdf
Renaissance@SNU 발표자료.pdf
 
AI: Planning and AI
AI: Planning and AIAI: Planning and AI
AI: Planning and AI
 
“How Transformers are Changing the Direction of Deep Learning Architectures,”...
“How Transformers are Changing the Direction of Deep Learning Architectures,”...“How Transformers are Changing the Direction of Deep Learning Architectures,”...
“How Transformers are Changing the Direction of Deep Learning Architectures,”...
 
Data Augmentation
Data AugmentationData Augmentation
Data Augmentation
 

Similar to CounterFactual Explanations.pdf

Machine Learning.pdf
Machine Learning.pdfMachine Learning.pdf
Machine Learning.pdfBeyaNasr1
 
Machine learning Mind Map
Machine learning Mind MapMachine learning Mind Map
Machine learning Mind MapAshish Patel
 
Deep learning concepts
Deep learning conceptsDeep learning concepts
Deep learning conceptsJoe li
 
ngboost.pptx
ngboost.pptxngboost.pptx
ngboost.pptxHadrian7
 
Learning machine learning with Yellowbrick
Learning machine learning with YellowbrickLearning machine learning with Yellowbrick
Learning machine learning with YellowbrickRebecca Bilbro
 
604_multiplee.ppt
604_multiplee.ppt604_multiplee.ppt
604_multiplee.pptRufesh
 
Guide for building GLMS
Guide for building GLMSGuide for building GLMS
Guide for building GLMSAli T. Lotia
 
Support Vector Machines USING MACHINE LEARNING HOW IT WORKS
Support Vector Machines USING MACHINE LEARNING HOW IT WORKSSupport Vector Machines USING MACHINE LEARNING HOW IT WORKS
Support Vector Machines USING MACHINE LEARNING HOW IT WORKSrajalakshmi5921
 
Model Selection and Validation
Model Selection and ValidationModel Selection and Validation
Model Selection and Validationgmorishita
 
Medical diagnosis classification
Medical diagnosis classificationMedical diagnosis classification
Medical diagnosis classificationcsandit
 
MEDICAL DIAGNOSIS CLASSIFICATION USING MIGRATION BASED DIFFERENTIAL EVOLUTION...
MEDICAL DIAGNOSIS CLASSIFICATION USING MIGRATION BASED DIFFERENTIAL EVOLUTION...MEDICAL DIAGNOSIS CLASSIFICATION USING MIGRATION BASED DIFFERENTIAL EVOLUTION...
MEDICAL DIAGNOSIS CLASSIFICATION USING MIGRATION BASED DIFFERENTIAL EVOLUTION...cscpconf
 
Artificial Intelligence Course: Linear models
Artificial Intelligence Course: Linear models Artificial Intelligence Course: Linear models
Artificial Intelligence Course: Linear models ananth
 
sentiment analysis using support vector machine
sentiment analysis using support vector machinesentiment analysis using support vector machine
sentiment analysis using support vector machineShital Andhale
 
Machine Learning Notes for beginners ,Step by step
Machine Learning Notes for beginners ,Step by stepMachine Learning Notes for beginners ,Step by step
Machine Learning Notes for beginners ,Step by stepSanjanaSaxena17
 
Multiple-Linear-Regression-Model-Analysis.pptx
Multiple-Linear-Regression-Model-Analysis.pptxMultiple-Linear-Regression-Model-Analysis.pptx
Multiple-Linear-Regression-Model-Analysis.pptxNaryCasila
 
Predicting Employee Attrition
Predicting Employee AttritionPredicting Employee Attrition
Predicting Employee AttritionShruti Mohan
 

Similar to CounterFactual Explanations.pdf (20)

Machine Learning.pdf
Machine Learning.pdfMachine Learning.pdf
Machine Learning.pdf
 
Machine learning
Machine learningMachine learning
Machine learning
 
Machine learning Mind Map
Machine learning Mind MapMachine learning Mind Map
Machine learning Mind Map
 
Deep learning concepts
Deep learning conceptsDeep learning concepts
Deep learning concepts
 
ngboost.pptx
ngboost.pptxngboost.pptx
ngboost.pptx
 
Learning machine learning with Yellowbrick
Learning machine learning with YellowbrickLearning machine learning with Yellowbrick
Learning machine learning with Yellowbrick
 
Ai saturdays presentation
Ai saturdays presentationAi saturdays presentation
Ai saturdays presentation
 
ngboost.pptx
ngboost.pptxngboost.pptx
ngboost.pptx
 
604_multiplee.ppt
604_multiplee.ppt604_multiplee.ppt
604_multiplee.ppt
 
working with python
working with pythonworking with python
working with python
 
Guide for building GLMS
Guide for building GLMSGuide for building GLMS
Guide for building GLMS
 
Support Vector Machines USING MACHINE LEARNING HOW IT WORKS
Support Vector Machines USING MACHINE LEARNING HOW IT WORKSSupport Vector Machines USING MACHINE LEARNING HOW IT WORKS
Support Vector Machines USING MACHINE LEARNING HOW IT WORKS
 
Model Selection and Validation
Model Selection and ValidationModel Selection and Validation
Model Selection and Validation
 
Medical diagnosis classification
Medical diagnosis classificationMedical diagnosis classification
Medical diagnosis classification
 
MEDICAL DIAGNOSIS CLASSIFICATION USING MIGRATION BASED DIFFERENTIAL EVOLUTION...
MEDICAL DIAGNOSIS CLASSIFICATION USING MIGRATION BASED DIFFERENTIAL EVOLUTION...MEDICAL DIAGNOSIS CLASSIFICATION USING MIGRATION BASED DIFFERENTIAL EVOLUTION...
MEDICAL DIAGNOSIS CLASSIFICATION USING MIGRATION BASED DIFFERENTIAL EVOLUTION...
 
Artificial Intelligence Course: Linear models
Artificial Intelligence Course: Linear models Artificial Intelligence Course: Linear models
Artificial Intelligence Course: Linear models
 
sentiment analysis using support vector machine
sentiment analysis using support vector machinesentiment analysis using support vector machine
sentiment analysis using support vector machine
 
Machine Learning Notes for beginners ,Step by step
Machine Learning Notes for beginners ,Step by stepMachine Learning Notes for beginners ,Step by step
Machine Learning Notes for beginners ,Step by step
 
Multiple-Linear-Regression-Model-Analysis.pptx
Multiple-Linear-Regression-Model-Analysis.pptxMultiple-Linear-Regression-Model-Analysis.pptx
Multiple-Linear-Regression-Model-Analysis.pptx
 
Predicting Employee Attrition
Predicting Employee AttritionPredicting Employee Attrition
Predicting Employee Attrition
 

Recently uploaded

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 

Recently uploaded (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 

CounterFactual Explanations.pdf

  • 2. Counterfactual Explanations • A counterfactual explanation describes a causal situation in the form: “If X had not occurred, Y would not have occurred” • In interpretable machine learning, counterfactual explanations can be used to explain predictions of individual instances • A counterfactual explanation of a prediction describes the smallest change to the feature values that changes the prediction to a prede fi ned output. • Counterfactuals are human-friendly explanations, because they are contrastive to the current instance and because they are selective, meaning they usually focus on a small number of feature changes. But counterfactuals su ff er from the ‘Rashomon e ff ect’. 
  • 3. What Is a Good Explanation? • Explanations are contrastive. → Humans do not want a complete explanation for a prediction, but want to compare what the di ff erences were to another instance’s prediction. • Explanations are selected. → Make the explanation very short, give only 1 to 3 reasons, even if the world is more complex. • Explanations are social. → Pay attention to the social environment of your machine learning application and the target audience. • Explanations focus on the abnormal. If one of the input features for a prediction was abnormal in any sense (like a rare category of a categorical feature) and the feature in fl uenced the prediction, it should be included in an explanation, even if other ‘normal’ features have the same in fl uence on the prediction as the abnormal one. https://brunch.co.kr/@bdh/33
  • 4. What is a good counterfactual explanation? • A counterfactual instance produces the prede fi ned prediction as closely as possible. • A counterfactual should be as similar as possible to the instance regarding feature values. • Multiple diverse counterfactual explanation • A counterfactual instance should have feature values that are likely.
  • 5. What is a good counterfactual explanation?
  • 6. Generating Counterfactual Explanations Method by Wachter et al • Objective Function: , • A higher value of λ means that we prefer counterfactuals with predictions close to the desired outcome y’ • Manhattan distance weighted with the inverse median absolute deviation (MAD) of each feature • Total distance is the sum of all p feature-wise distances: • → It is the equivalent of the variance of a feature(more robust to outliers than Euclidian distance) • Instead of λ, the author suggest to use arg min x′  max λ L(x, x′  , y′  , λ) L(x, x′  , y′  , λ) = λ ⋅ ( ̂ f(x′  ) − y′  )2 + d(x, x′  ) d(x, x′  ) = p ∑ j=1 |xj − x′  j | MADj MADj = mediani∈{1,…,n}(|xi,j − medianl∈{1,…,n}(xl,j)|) ϵ(Tolerance) : | ̂ f(x′  ) − y′  | ≤ ϵ
  • 7. Generating Counterfactual Explanations(Cont.d) Method by Wachter et al • Process • Select an instance x to be explained, the desired outcome y’, a tolerance ϵ and a (low) initial value for λ • Sample a random instance as initial counterfactual. • Optimize the loss with the initially sampled counterfactual as starting point. • While • Increase • Optimize the loss with the current counterfactual as starting point. • Return the counterfactual that minimizes the loss. • Repeat steps 2-4 and return the list of counterfactuals or the one that minimizes the loss. | ̂ f(x′  ) − y′  | > ϵ λ
  • 8. Generating Counterfactual Explanations(Cont.d) Method by Wachter et al • It only takes the fi rst and second criteria into account not the last two (“produce counterfactuals with only a few feature changes and likely feature values”). • The method does not handle categorical features with many di ff erent levels well. • The authors of the method suggested running the method separately for each combination of feature values of the categorical features → High computation cost
  • 9. Generating Counterfactual Explanations(Cont.d) Method by Dandl et al • Loss Function: • Multi Objective Function: • , , 
 , • Gowel’s Distance: • : The observed value range, scales for all features is between 0 and 1 L(x, x′  , y′  , Xobs ) = (o1( ̂ f(x′  ), y′  ), o2(x, x′  ), o3(x, x′  ), o4(x′  , Xobs )) o1( ^ f(x′  ), y′  ) = 0 if  ^ f(x′  ) ∈ y′  inf y′  ∈y′  | ^ f(x′  ) − y′  | else o2(x, x′  ) = 1 p p ∑ j=1 δG(xj, x′  j) o3(x, x′  ) = ||x − x′  ||0 = p ∑ j=1 𝕀 x′  j≠xj o4(x′  , Xobs) = 1 p p ∑ j=1 δG(x′  j, x[1] j ) δG(xj, x′  j) = 1 ^ Rj |xj − x′  j | if xj numerical 𝕀 xj≠x′  j if xj categorical ̂ R j δG
  • 10. Generating Counterfactual Explanations(Cont.d) Method by Dandl et al • NSGA-II: A method for solving multi-objective optimization problems by fi nding multiple Pareto solutions. (Especially, using Nondominated Sorting, Crowding Distance) • In the fi rst generation a group of counterfactual candidates is initialized by randomly changing some of the features compared to our instance x to be explained. • a candidate is then evaluated using the four objective functions of above. Among them, we randomly select some candidates, where fi tter candidates are more likely to be selected. • The nondominated sorting algorithm sorts the candidates according to their objective values. If candidates are equally good, the crowding distance sorting algorithm sorts the candidates according to their diversity. • A가 B에 대해서 모든 평가척도에서 우위를 가질 때 B is dominated 했다고 표현하고, Dominating Set을 파레토 최적해 집합이라 고 하고 파레토 최적해가 이루는 경계선을 Pareto front라고 한다. Pareto front와 거리가 가까을 수록 높은 순위가 부여됨 • Given the ranking of the two sorting algorithms, we select the most promising and/or most diverse half of the candidates. We use this set for the next generation and start again with the selection, recombination and mutation process. • Evaluation Metric: HyperVolume Parameter
  • 11. Example • Support vector machine (with radial basis kernel) to predict the probability that a customer has a good credit risk. • The goal is to fi nd counterfactual explanations for a customer with the following feature values: • The SVM predicts that the woman has a good credit risk with a probability of 24.2 %. The counterfactuals should answer how the input features need to be changed to get a predicted probability larger than 50 %?
  • 12. Example (Cont.d) • The fi rst fi ve columns contain the proposed feature changes (only altered features are displayed), the next three columns show the objective values • All counterfactuals have predicted probabilities greater than 50 % and do not dominate each other. Non-dominated means that none of the counterfactuals has smaller values in all objectives than the other counterfactuals.
  • 13. Advantages • The interpretation of counterfactual explanations is very clear. If the feature values of an instance are changed according to the counterfactual, the prediction changes to the prede fi ned prediction. • The counterfactual method does not require access to the data or the model. It only requires access to the model’s prediction function, which would also work via a web API, for example. • The method works also with systems that do not use machine learning. • The counterfactual explanation method is relatively easy to implement.
  • 14. Disadvantages • For each instance you will usually fi nd multiple counterfactual explanations (Rashomon e ff ect).
  • 15. Bonus Model Speci fi c CFE vs Model Agonistic CFE
  • 18. Generating Counterfactual Explanations(Cont.d) Method by Dandl et al • NSGA-II: A method for solving multi-objective optimization problems by fi nding multiple Pareto solutions. (Especially, using Nondominated Sorting, Crowding Distance) • A가 B에 대해서 모든 평가척도에서 우위를 가질 때 B is dominated 했다고 표현하고, Dominating Set을 파레토 최적해 집합이라고 하고 파레토 최적해들이 이루는 경계선을 파레토 경계 라고 한다. 다목적 최적화 알고리즘은 이 파레토 경계와 가까운 것을 기준으로 해들의 우수성을 평가한다. • Nondominated Sorting Algorithm: 파레토 경계와 거리가 가까을 수록 높은 순위가 부여됨 → 지배되지 않은 해의 집합이 우선순위를 가지게 된다. • Crowding Distance Sorting Algorithm: 유사하지 않을 수록 높은 Crowding Distance를 가짐 → 다양성에 높은 점수를 부여 • In the fi rst generation a group of counterfactual candidates is initialized by randomly changing some of the features compared to our instance x to be explained.