SlideShare uma empresa Scribd logo
1 de 18
Baixar para ler 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.

Mais conteúdo relacionado

Mais procurados

Interpretable machine learning : Methods for understanding complex models
Interpretable machine learning : Methods for understanding complex modelsInterpretable machine learning : Methods for understanding complex models
Interpretable machine learning : Methods for understanding complex modelsManojit Nandi
 
Scott Lundberg, Microsoft Research - Explainable Machine Learning with Shaple...
Scott Lundberg, Microsoft Research - Explainable Machine Learning with Shaple...Scott Lundberg, Microsoft Research - Explainable Machine Learning with Shaple...
Scott Lundberg, Microsoft Research - Explainable Machine Learning with Shaple...Sri Ambati
 
Explainable AI in Industry (KDD 2019 Tutorial)
Explainable AI in Industry (KDD 2019 Tutorial)Explainable AI in Industry (KDD 2019 Tutorial)
Explainable AI in Industry (KDD 2019 Tutorial)Krishnaram Kenthapadi
 
Feature Selection in Machine Learning
Feature Selection in Machine LearningFeature Selection in Machine Learning
Feature Selection in Machine LearningUpekha Vandebona
 
Explainability for Natural Language Processing
Explainability for Natural Language ProcessingExplainability for Natural Language Processing
Explainability for Natural Language ProcessingYunyao Li
 
Explainable AI in Industry (FAT* 2020 Tutorial)
Explainable AI in Industry (FAT* 2020 Tutorial)Explainable AI in Industry (FAT* 2020 Tutorial)
Explainable AI in Industry (FAT* 2020 Tutorial)Krishnaram Kenthapadi
 
Vanishing & Exploding Gradients
Vanishing & Exploding GradientsVanishing & Exploding Gradients
Vanishing & Exploding GradientsSiddharth Vij
 
Diffusion models beat gans on image synthesis
Diffusion models beat gans on image synthesisDiffusion models beat gans on image synthesis
Diffusion models beat gans on image synthesisBeerenSahu
 
hands on machine learning Chapter 6&7 decision tree, ensemble and random forest
hands on machine learning Chapter 6&7 decision tree, ensemble and random foresthands on machine learning Chapter 6&7 decision tree, ensemble and random forest
hands on machine learning Chapter 6&7 decision tree, ensemble and random forestJaey Jeong
 
The Evolution of AutoML
The Evolution of AutoMLThe Evolution of AutoML
The Evolution of AutoMLNing Jiang
 
Explainability for Natural Language Processing
Explainability for Natural Language ProcessingExplainability for Natural Language Processing
Explainability for Natural Language ProcessingYunyao Li
 
Explaining Black-Box Machine Learning Predictions - Sameer Singh, Assistant P...
Explaining Black-Box Machine Learning Predictions - Sameer Singh, Assistant P...Explaining Black-Box Machine Learning Predictions - Sameer Singh, Assistant P...
Explaining Black-Box Machine Learning Predictions - Sameer Singh, Assistant P...Sri Ambati
 
Methods of Optimization in Machine Learning
Methods of Optimization in Machine LearningMethods of Optimization in Machine Learning
Methods of Optimization in Machine LearningKnoldus Inc.
 
Hyperparameter Tuning
Hyperparameter TuningHyperparameter Tuning
Hyperparameter TuningJon Lederman
 
Interpretability beyond feature attribution quantitative testing with concept...
Interpretability beyond feature attribution quantitative testing with concept...Interpretability beyond feature attribution quantitative testing with concept...
Interpretability beyond feature attribution quantitative testing with concept...MLconf
 
Reinforcement Learning In AI Powerpoint Presentation Slide Templates Complete...
Reinforcement Learning In AI Powerpoint Presentation Slide Templates Complete...Reinforcement Learning In AI Powerpoint Presentation Slide Templates Complete...
Reinforcement Learning In AI Powerpoint Presentation Slide Templates Complete...SlideTeam
 
Model selection and cross validation techniques
Model selection and cross validation techniquesModel selection and cross validation techniques
Model selection and cross validation techniquesVenkata Reddy Konasani
 

Mais procurados (20)

Interpretable machine learning : Methods for understanding complex models
Interpretable machine learning : Methods for understanding complex modelsInterpretable machine learning : Methods for understanding complex models
Interpretable machine learning : Methods for understanding complex models
 
Scott Lundberg, Microsoft Research - Explainable Machine Learning with Shaple...
Scott Lundberg, Microsoft Research - Explainable Machine Learning with Shaple...Scott Lundberg, Microsoft Research - Explainable Machine Learning with Shaple...
Scott Lundberg, Microsoft Research - Explainable Machine Learning with Shaple...
 
Explainable AI in Industry (KDD 2019 Tutorial)
Explainable AI in Industry (KDD 2019 Tutorial)Explainable AI in Industry (KDD 2019 Tutorial)
Explainable AI in Industry (KDD 2019 Tutorial)
 
Feature Selection in Machine Learning
Feature Selection in Machine LearningFeature Selection in Machine Learning
Feature Selection in Machine Learning
 
Explainable AI
Explainable AIExplainable AI
Explainable AI
 
Explainability for Natural Language Processing
Explainability for Natural Language ProcessingExplainability for Natural Language Processing
Explainability for Natural Language Processing
 
Explainable AI in Industry (FAT* 2020 Tutorial)
Explainable AI in Industry (FAT* 2020 Tutorial)Explainable AI in Industry (FAT* 2020 Tutorial)
Explainable AI in Industry (FAT* 2020 Tutorial)
 
Learning from imbalanced data
Learning from imbalanced data Learning from imbalanced data
Learning from imbalanced data
 
Vanishing & Exploding Gradients
Vanishing & Exploding GradientsVanishing & Exploding Gradients
Vanishing & Exploding Gradients
 
Diffusion models beat gans on image synthesis
Diffusion models beat gans on image synthesisDiffusion models beat gans on image synthesis
Diffusion models beat gans on image synthesis
 
hands on machine learning Chapter 6&7 decision tree, ensemble and random forest
hands on machine learning Chapter 6&7 decision tree, ensemble and random foresthands on machine learning Chapter 6&7 decision tree, ensemble and random forest
hands on machine learning Chapter 6&7 decision tree, ensemble and random forest
 
Shap
ShapShap
Shap
 
The Evolution of AutoML
The Evolution of AutoMLThe Evolution of AutoML
The Evolution of AutoML
 
Explainability for Natural Language Processing
Explainability for Natural Language ProcessingExplainability for Natural Language Processing
Explainability for Natural Language Processing
 
Explaining Black-Box Machine Learning Predictions - Sameer Singh, Assistant P...
Explaining Black-Box Machine Learning Predictions - Sameer Singh, Assistant P...Explaining Black-Box Machine Learning Predictions - Sameer Singh, Assistant P...
Explaining Black-Box Machine Learning Predictions - Sameer Singh, Assistant P...
 
Methods of Optimization in Machine Learning
Methods of Optimization in Machine LearningMethods of Optimization in Machine Learning
Methods of Optimization in Machine Learning
 
Hyperparameter Tuning
Hyperparameter TuningHyperparameter Tuning
Hyperparameter Tuning
 
Interpretability beyond feature attribution quantitative testing with concept...
Interpretability beyond feature attribution quantitative testing with concept...Interpretability beyond feature attribution quantitative testing with concept...
Interpretability beyond feature attribution quantitative testing with concept...
 
Reinforcement Learning In AI Powerpoint Presentation Slide Templates Complete...
Reinforcement Learning In AI Powerpoint Presentation Slide Templates Complete...Reinforcement Learning In AI Powerpoint Presentation Slide Templates Complete...
Reinforcement Learning In AI Powerpoint Presentation Slide Templates Complete...
 
Model selection and cross validation techniques
Model selection and cross validation techniquesModel selection and cross validation techniques
Model selection and cross validation techniques
 

Semelhante a 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
 
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
 

Semelhante a 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
 
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
 
Logistical Regression.pptx
Logistical Regression.pptxLogistical Regression.pptx
Logistical Regression.pptx
 

Último

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 

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.