Skip to content

Commit bc99230

Browse files
committed
Update notebook
1 parent b0ddc5d commit bc99230

File tree

1 file changed

+28
-26
lines changed

1 file changed

+28
-26
lines changed

notebooks/Counterfactuals.ipynb

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
{
1212
"cell_type": "code",
13-
"execution_count": 1,
13+
"execution_count": 2,
1414
"id": "569777b3",
1515
"metadata": {},
1616
"outputs": [],
@@ -59,7 +59,7 @@
5959
},
6060
{
6161
"cell_type": "code",
62-
"execution_count": 4,
62+
"execution_count": 3,
6363
"id": "22ba9951",
6464
"metadata": {},
6565
"outputs": [],
@@ -90,7 +90,7 @@
9090
},
9191
{
9292
"cell_type": "code",
93-
"execution_count": 5,
93+
"execution_count": 4,
9494
"id": "5bcb0105",
9595
"metadata": {},
9696
"outputs": [],
@@ -110,7 +110,7 @@
110110
},
111111
{
112112
"cell_type": "code",
113-
"execution_count": 11,
113+
"execution_count": 5,
114114
"id": "6aa524ae",
115115
"metadata": {},
116116
"outputs": [],
@@ -131,20 +131,20 @@
131131
},
132132
{
133133
"cell_type": "code",
134-
"execution_count": 12,
134+
"execution_count": 6,
135135
"id": "f0f07043",
136136
"metadata": {},
137137
"outputs": [
138138
{
139139
"name": "stdout",
140140
"output_type": "stream",
141141
"text": [
142-
"Feature f-num1 has value 9.344140417436046\n",
143-
"Feature f-num2 has value 2.101222990524685\n",
144-
"Feature f-num3 has value 5.759573701749472\n",
145-
"Feature f-num4 has value 0.8173260627331469\n",
142+
"Feature f-num1 has value 9.35846230523286\n",
143+
"Feature f-num2 has value 7.791718241742139\n",
144+
"Feature f-num3 has value 0.30365991828529393\n",
145+
"Feature f-num4 has value 2.8165353533668114\n",
146146
"\n",
147-
"Features sum is 18.02226317244335\n"
147+
"Features sum is 20.27037581862711\n"
148148
]
149149
}
150150
],
@@ -167,7 +167,7 @@
167167
},
168168
{
169169
"cell_type": "code",
170-
"execution_count": 20,
170+
"execution_count": 7,
171171
"id": "513d2e5a",
172172
"metadata": {},
173173
"outputs": [],
@@ -185,7 +185,7 @@
185185
},
186186
{
187187
"cell_type": "code",
188-
"execution_count": 13,
188+
"execution_count": 8,
189189
"id": "30dcc15b",
190190
"metadata": {},
191191
"outputs": [],
@@ -205,7 +205,7 @@
205205
},
206206
{
207207
"cell_type": "code",
208-
"execution_count": 14,
208+
"execution_count": 9,
209209
"id": "9cfe2a9d",
210210
"metadata": {},
211211
"outputs": [],
@@ -227,7 +227,7 @@
227227
},
228228
{
229229
"cell_type": "code",
230-
"execution_count": 15,
230+
"execution_count": 10,
231231
"id": "bcd25df0",
232232
"metadata": {},
233233
"outputs": [],
@@ -255,7 +255,7 @@
255255
},
256256
{
257257
"cell_type": "code",
258-
"execution_count": 16,
258+
"execution_count": 11,
259259
"id": "c2b76274",
260260
"metadata": {},
261261
"outputs": [
@@ -289,7 +289,7 @@
289289
},
290290
{
291291
"cell_type": "code",
292-
"execution_count": 17,
292+
"execution_count": 12,
293293
"id": "92356f76",
294294
"metadata": {},
295295
"outputs": [],
@@ -311,7 +311,7 @@
311311
},
312312
{
313313
"cell_type": "code",
314-
"execution_count": 21,
314+
"execution_count": 13,
315315
"id": "19a001ac",
316316
"metadata": {},
317317
"outputs": [],
@@ -332,7 +332,7 @@
332332
},
333333
{
334334
"cell_type": "code",
335-
"execution_count": 22,
335+
"execution_count": 14,
336336
"id": "e5783b3d",
337337
"metadata": {},
338338
"outputs": [],
@@ -350,7 +350,7 @@
350350
},
351351
{
352352
"cell_type": "code",
353-
"execution_count": 23,
353+
"execution_count": 15,
354354
"id": "cc2ad21e",
355355
"metadata": {},
356356
"outputs": [],
@@ -368,28 +368,30 @@
368368
},
369369
{
370370
"cell_type": "code",
371-
"execution_count": 25,
371+
"execution_count": 19,
372372
"id": "6f1e04c1",
373373
"metadata": {},
374374
"outputs": [
375375
{
376376
"name": "stdout",
377377
"output_type": "stream",
378378
"text": [
379-
"java.lang.DoubleFeature{value=490.4373902874999, intRangeMinimum=0.0, intRangeMaximum=1000.0, id='f-num1'}\n",
380-
"java.lang.DoubleFeature{value=2.420079314517709, intRangeMinimum=0.0, intRangeMaximum=1000.0, id='f-num2'}\n",
381-
"java.lang.DoubleFeature{value=5.759573701749472, intRangeMinimum=0.0, intRangeMaximum=1000.0, id='f-num3'}\n",
382-
"java.lang.DoubleFeature{value=0.8173260627331469, intRangeMinimum=0.0, intRangeMaximum=1000.0, id='f-num4'}\n"
379+
"java.lang.DoubleFeature{value=9.35846230523286, intRangeMinimum=0.0, intRangeMaximum=1000.0, id='f-num1'}\n",
380+
"java.lang.DoubleFeature{value=7.868907841140915, intRangeMinimum=0.0, intRangeMaximum=1000.0, id='f-num2'}\n",
381+
"java.lang.DoubleFeature{value=0.30365991828529393, intRangeMinimum=0.0, intRangeMaximum=1000.0, id='f-num3'}\n",
382+
"java.lang.DoubleFeature{value=481.78810412867466, intRangeMinimum=0.0, intRangeMaximum=1000.0, id='f-num4'}\n",
383+
"\n",
384+
"Feature sum is 499.31913419333375\n"
383385
]
384386
}
385387
],
386388
"source": [
387389
"feature_sum = 0.0\n",
388390
"for entity in explanation.getEntities():\n",
389391
" print(entity)\n",
390-
" feature_sum += entity.getValue().asNumber()\n",
392+
" feature_sum += entity.getProposedValue()\n",
391393
" \n",
392-
"print(f\"\\nFeature sum is {fe}\")"
394+
"print(f\"\\nFeature sum is {feature_sum}\")"
393395
]
394396
},
395397
{

0 commit comments

Comments
 (0)