A
agnostic AutoML template
agnostic model
explaining, with SHAP 143
AI bias
autopilot decision making 55
decision tree, building 58
ethical AI moral limits, explaining 59, 60
MIT Moral Machine experiment 57
using, in self-driving cars (SDCs) 55
AI diagnosis
enhancing, with XAI 41
Alibi
installing 333
anchors AI explanations 357
for ImageNet 361
newsgroup discussions, classifying 359, 361
anchors AI explanations, for ImageNet
anchor image explainer, building 364, 365, 366, 367
image, processing 364
InceptionV3 model 362
predictions, making 364
area under the curve (AUC) 226
autoencoder
creating 343
defining 342
original images, comparing with decoded images 345, 346
AutoML
interactive choice, of classifier 283, 284
model, training 283
prediction process, finalizing 284
predictions, making 283
autopilot decision tree
accuracy 78
accuracy, measuring 82
building 61
customized structure, output 78, 79, 80, 81
decision tree classifiers, creating 67
decision tree classifiers, defining 66, 67
ethics, using to control 81
ML ethics and laws 85
model, loading 82
model, saving 69
nodes, considering 77
real-time cases, simulating 83
structure 74
structure, customized output 76
XAI, applying 74
XAI, using to control 81
B
bagging classifier 279
black box models
migrating, to XAI white box models 4
C
CEM, applying to MNIST 333
Alibi, installing 333
data, categorizing 337
data, preparing 335
data, scaling 336
dataset, importing 333, 334, 335
data, shaping 336
modules, installing 333
cognitive explanation function 383, 384, 385, 386
cognitive rule-based explanations 377
XAI tools, migrating to XAI concepts 377
cognitive XAI method 380
contrastive explanations method (CEM) 330, 331, 332
applying, to MNIST 333
human cognitive input 396
rule-based perspectives 397, 398, 399, 400, 401
convolutional neural network (CNN) 324
convolutional neural network (CNN) model
accuracy, testing 341
convolutional layer 337
creating 339
defining 337
dense layer 338
dropout layer 338
flatten layer 338
loading 341
pooling layer 337
Correctional Offender Management Profiling for Alternative Sanctions (COMPAS) 199
counterfactual distances
counterfactual explanations, logic 310
justification 314
counterfactual explanations method 301
data point distances, exploring with default view 304, 305, 306, 307, 308, 309
datasets 301
motivations 301
count features 203
CUI XAI dialog
Jupyter Notebook XAI agent manager 263
using, in Google Dialogflow 259
with Google Assistant 264, 265
custom distance functions 320
D
data
designing 6
extracting 6
data extraction tool
reference link 29
datasets
retrieving 275
decision tree classifier 280
deep learning model, architecture 320
custom prediction, for WIT 322, 323
dataset, retrieving 325
model, retrieving 325
deep neural network (DNN) 190
dialog function
distance functions 316
custom distance functions 320
DNN model
training 211
E
EEOC laws ban 168
Equal Employment Opportunity Commission (EEOC)
reference link 168
ethical AI perspective, Google�s WIT 199
interpretability 198, 199, 200
ethical perspective rules, U.S. census data problem
AI project, with controversial data, avoiding 168
controversial data, excluding form dataset 167
ethics
using, to control autopilot decision tree 81
experimental AutoML module 276
explainable AI (XAI)
for educational purposes 185, 186
explaining 6
extra trees classifiers 281
F
Facets
data files, reading 94
installing, on Google Colaboratory 93
starting with 92
Facets Dive
about 105
colors, adding to data points 109
display code, building 105, 106, 107
labels, displaying on data points 107, 108
x axis and y axis binning, defining 110, 111
x axis and y axis scatter plot, defining 111, 112, 113
Facets Overview
about 95
feature statistics, creating for datasets 95
false positives (FP) 223
feature statistics, Facets Overview
creating, for datasets 95
data, sorting by feature order 98
displaying, with HTML code 96, 97
sorting, by alphabetical order 102
sorting, by amount missing/zero 103
sorting, by distribution distance 103, 104, 105
sorting, by non-uniformity 99, 100, 101, 102
follow-up 249
G
General Data Protection Regulation (GDPR) 169
Google Colaboratory
Facet, installing 93
LIME, installing on 275
Google Dialogflow
access, via writing Python client 241, 242, 243, 244
agent, creating 236, 237, 238, 239
CUI XAI dialog, using 259
dialog function, creating 245, 246
enhancing, for Python client 245
integration, for website 260, 261, 262, 263
interacting, with Python client 258, 259
URL 236
used, for installing Python client 234, 235
XAI implementation, constraints 246, 247
XAI Python client 254
Google Location History
data extraction tool, using 28, 29, 30, 31
used, by XAI 26
Google Location History data
importing 34
import instructions 33
plotting options, setting up 36, 38, 39, 40
processing, for XAI and basemap 35, 36
used, for installing basemap packages 33
Google�s WIT
ethical AI perspective 198
legal perspective 200
gradient boosting classifier 280
I
ImageNet
anchor AI explanations 361
IMDb
reference link 129
IMDb vectorizer
intent
creating, in Google Dialogflow 247, 248
follow-up intent, defining 249, 251, 252, 253
response 249
interactions
inserting, in MDP 255, 256, 257
intercepted dataset reviews, with SHAP 147
interception functions 285
interpretability 6
inverse document frequency (IDF) 129
J
Jupyter Notebook XAI agent manager 263
K
key principles, SHAP 117
additivity 119
L
LIME
LIME explanations
conclusions 295
interpreting 290
linear models
explainer, creating 143
output, creating 138, 139, 140
output, training 138, 139, 140
output, visualizing 138, 139, 140
linear model�s prediction output
intercepted dataset reviews, with SHAP 147
original IMDb reviews, explaining with SHAP 150, 151, 152
Local Interpretable Model-Agnostic Explanations (LIME) 270, 271, 274
installing, on Google Colaboratory 275
mathematical representation 272, 273, 274
M
marginal contribution, feature 386
mathematical perspective 386, 387
Markov decision process (MDP)
interactions, inserting 256, 257
interactions, inserting in 255
Matplotlib
documentation, reference link 33
medical diagnosis experimental program
XAI, applying 45
MIT Moral Machine experiment
reference link 57
ML ethics and laws
about 85
emotional intelligence, in autopilot 87, 88
traffic regulations, override avoiding 85, 87
traffic regulations, overriding 87
ML perspectives, U.S. census data problem
anticipated outputs, analysis conclusion 183, 184
anticipated outputs, verifying 177
anticipated outputs, verifying with KMC 177, 178, 179, 180
input data, transforming 184, 185, 186
KMC algorithm output, analyzing 180, 181, 182, 183
training data, analyzing with Facets 173, 174, 175, 176
training data, displaying with Facets Dive 170, 172, 173
MNIST
CEM, applying to 333
model-agnostic approach 122
model outputs 212, 213, 214, 215
O
original IMDb reviews, explaining with SHAP 150, 151, 152
negative review sample 152, 153
positive review sample 153, 155
P
performance and fairness, WIT
confusion matrix 229
cost ratio 223
ground truth 222
PR curve 228
slicing 224
pertinent negative explanation
CEM explainer, initializing 349
creating 348
creation, by setting CEM parameters 348, 349
pertinent negative (PN) 343
contrastive explanation, visualizing 348
pertinent positive (PP) 343
contrastive explanation, visualizing 347
plot function
precision-recall curves (PR) 228
Python
KNN algorithm, building 12, 13, 14, 16, 17, 18, 19
Python client
APIs and services, enabling 239, 240, 241
installing, for Google Dialogflow 234, 235
used, for enhancing Google Dialogflow 245
used, for interacting Google Dialogflow 258, 259
writing, to access Google Dialogflow 241, 242, 243, 244
Python Imaging Library (PIL) 322
Python marginal cognitive contribution function 387, 388, 390
R
Race Equality Directive (RED) 169
receiver operating characteristic (ROC) 225
S
scores
interpreting 282
self-driving cars (SDCs)
AI bias, using 55
sentiment analysis 301
sentiment analysis example, SHAP 122, 123
value, for excellent 126
values, verifying 127
service-level agreement (SLA) 8
SHAP explainer
creating 211
values plot 212
SHapley Additive exPlanations (SHAP)
about 117
data interception function 132, 133, 134, 135
dataset, intercepting 130
datasets, vectorizing 136, 137
installing 128
key principles 117
modules, importing 128
sentiment analysis example 122, 123
starting with 128
used, for explaining agnostic model 143
used, for explaining intercepted dataset reviews 147
used, for explaining original IMDb reviews 150, 155
value, mathematical expression 120, 121, 122
standard AI program, used by practitioner 11
KNN algorithm, defining 11, 12
subject matter expert (SME) 19
T
text frequency (TF) 129
true positives (TP) 223
U
U.S. census data problem
ethical perspective 167
legal perspective 168, 169, 170
ML perspectives 170
pandas, using to display data 162, 163, 164
V
vectorizer
vectorizers
virtualenv
reference link 235
W
West Nile virus 19
medical example 19, 20, 21, 22, 23
What-If Tool (WIT)
applying, to transformed dataset 186, 187, 188, 189, 190, 191, 192, 193, 194, 195
datapoint explorer 216, 218, 219, 220, 221
data, preprocessing 206, 207, 208
data structures creation, for training and testing 208
performance and fairness 216, 222
white box 5
WIT
counterfactual distances, visualizing 302, 303
work in progress (WIP) 253
X
XAI
applying, to autopilot decision tree 74
implementing 8
KNN, enhancing 41, 42, 43, 44, 45
used, for concluding critical diagnosis 50
used, for enhancing AI diagnosis 41
using, to control autopilot decision tree 81
XAI, applying medical diagnosis experimental program
mosquito detection data and natural language explanations, displaying 50
XAI, applying to medical diagnosis experimental program 45
KNN plot, displaying 46
Location History map, displaying 48, 49
mosquito detection data and natural language explanations, displaying 49
natural language explanations 47, 48
XAI approaches
AI to explain 9
expert 8
explaining 8
explicit 8
implicit 8
intuitive 8
objective 8
subjective 8
XAI implementation
constraints, on Google Dialogflow 246, 247
XAI medical diagnosis timeline 10
KNN algorithm, building in Python 12, 13, 14, 15, 17, 18, 19
standard AI program, used by practitioner 11
XAI Python client
about 254
interactions, inserting in MDP 255, 256, 257
XAI white box models
18.117.99.152