Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Levenshtein example. Bump TrustyAI to 0.4.0 #39

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
210 changes: 100 additions & 110 deletions examples/Counterfactuals.ipynb

Large diffs are not rendered by default.

104 changes: 48 additions & 56 deletions examples/Dataset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,55 +74,55 @@
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>110.775961</td>\n",
" <td>8897.843314</td>\n",
" <td>769f28d7-df70-4907-8f49-f8a5efeadbb2</td>\n",
" <td>17</td>\n",
" <td>False</td>\n",
" <td>199.691719</td>\n",
" <td>8423.634001</td>\n",
" <td>aa433471-f2f4-4210-beab-2a5fde4afc93</td>\n",
" <td>13</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>134.706970</td>\n",
" <td>5968.935158</td>\n",
" <td>4d22cc7d-db38-4e25-8be4-f18394fb3705</td>\n",
" <td>33</td>\n",
" <td>False</td>\n",
" <td>175.015510</td>\n",
" <td>5144.954980</td>\n",
" <td>8c8cfe67-7257-4f3d-9506-f4816c4e770e</td>\n",
" <td>41</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>124.157443</td>\n",
" <td>6880.264047</td>\n",
" <td>8de2e39b-406c-48ce-a6cc-169ee8f73ef0</td>\n",
" <td>39</td>\n",
" <td>181.826085</td>\n",
" <td>8659.891995</td>\n",
" <td>7bd8c06d-1064-4f13-b372-c65af8e30149</td>\n",
" <td>41</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>170.961902</td>\n",
" <td>8536.049163</td>\n",
" <td>5727068c-35c9-4cde-83f0-9b5f522373de</td>\n",
" <td>39</td>\n",
" <td>166.700817</td>\n",
" <td>7487.153923</td>\n",
" <td>2b0370a4-b41e-4b16-9c1f-a65f0a65464c</td>\n",
" <td>3</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>172.601273</td>\n",
" <td>7478.442753</td>\n",
" <td>76c9587b-e68f-45e8-a39d-ed9fab2b5609</td>\n",
" <td>11</td>\n",
" <td>False</td>\n",
" <td>157.718382</td>\n",
" <td>5539.941095</td>\n",
" <td>6c245358-d261-4e15-8517-c3f09ecdac66</td>\n",
" <td>24</td>\n",
" <td>True</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" x1 x2 x3 x4 select\n",
"0 110.775961 8897.843314 769f28d7-df70-4907-8f49-f8a5efeadbb2 17 False\n",
"1 134.706970 5968.935158 4d22cc7d-db38-4e25-8be4-f18394fb3705 33 False\n",
"2 124.157443 6880.264047 8de2e39b-406c-48ce-a6cc-169ee8f73ef0 39 True\n",
"3 170.961902 8536.049163 5727068c-35c9-4cde-83f0-9b5f522373de 39 False\n",
"4 172.601273 7478.442753 76c9587b-e68f-45e8-a39d-ed9fab2b5609 11 False"
"0 199.691719 8423.634001 aa433471-f2f4-4210-beab-2a5fde4afc93 13 True\n",
"1 175.015510 5144.954980 8c8cfe67-7257-4f3d-9506-f4816c4e770e 41 True\n",
"2 181.826085 8659.891995 7bd8c06d-1064-4f13-b372-c65af8e30149 41 True\n",
"3 166.700817 7487.153923 2b0370a4-b41e-4b16-9c1f-a65f0a65464c 3 False\n",
"4 157.718382 5539.941095 6c245358-d261-4e15-8517-c3f09ecdac66 24 True"
]
},
"execution_count": 3,
Expand Down Expand Up @@ -185,7 +185,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[Feature{name='x1', type=number, value=110.77596090318106}, Feature{name='x2', type=number, value=8897.843313935722}, Feature{name='x3', type=categorical, value=769f28d7-df70-4907-8f49-f8a5efeadbb2}, Feature{name='x4', type=number, value=17}]\n"
"[Feature{name='x1', type=number, value=199.69171905389746}, Feature{name='x2', type=number, value=8423.634000506001}, Feature{name='x3', type=categorical, value=aa433471-f2f4-4210-beab-2a5fde4afc93}, Feature{name='x4', type=number, value=13}]\n"
]
}
],
Expand Down Expand Up @@ -224,7 +224,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[Output{value=false, type=boolean, score=1.0, name='select'}]\n"
"[Output{value=true, type=boolean, score=1.0, name='select'}]\n"
]
}
],
Expand Down Expand Up @@ -260,7 +260,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[Feature{name='x2', type=number, value=8897.843313935722}, Feature{name='x3', type=categorical, value=769f28d7-df70-4907-8f49-f8a5efeadbb2}, Feature{name='select', type=boolean, value=false}]\n"
"[Feature{name='x2', type=number, value=8423.634000506001}, Feature{name='x3', type=categorical, value=aa433471-f2f4-4210-beab-2a5fde4afc93}, Feature{name='select', type=boolean, value=true}]\n"
]
}
],
Expand All @@ -278,7 +278,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[Output{value=110.77596090318106, type=number, score=1.0, name='x1'}, Output{value=17.0, type=number, score=1.0, name='x4'}]\n"
"[Output{value=199.69171905389746, type=number, score=1.0, name='x1'}, Output{value=13.0, type=number, score=1.0, name='x4'}]\n"
]
}
],
Expand Down Expand Up @@ -313,16 +313,16 @@
{
"data": {
"text/plain": [
"array([[0.4941837 , 0.54138924, 0.79744718, 0.75966474, 0.6663965 ],\n",
" [0.61321356, 0.93126828, 0.33589273, 0.41798983, 0.77295471],\n",
" [0.0741324 , 0.22773897, 0.8609951 , 0.14798847, 0.29693842],\n",
" [0.51173195, 0.29453894, 0.06253411, 0.39614618, 0.11552075],\n",
" [0.46702147, 0.11739192, 0.2025332 , 0.19551742, 0.86863743],\n",
" [0.17245352, 0.17041101, 0.57627698, 0.68669061, 0.37271922],\n",
" [0.33980101, 0.45839755, 0.32261154, 0.9704679 , 0.13569625],\n",
" [0.19868834, 0.30223221, 0.40911422, 0.53045714, 0.14810708],\n",
" [0.85424792, 0.53920094, 0.17639279, 0.0272658 , 0.59151213],\n",
" [0.94555969, 0.67387324, 0.06552553, 0.02347923, 0.3843669 ]])"
"array([[0.68468018, 0.60703705, 0.7619673 , 0.56649717, 0.72130264],\n",
" [0.89003104, 0.84624854, 0.01211185, 0.271607 , 0.58048523],\n",
" [0.32379929, 0.33718089, 0.41112117, 0.82583901, 0.65967431],\n",
" [0.48934436, 0.28016091, 0.21326921, 0.66476719, 0.09109155],\n",
" [0.02946721, 0.8990184 , 0.39921803, 0.7282812 , 0.18430694],\n",
" [0.04172949, 0.39444183, 0.04355018, 0.88119431, 0.25622821],\n",
" [0.76606467, 0.60040384, 0.07779518, 0.67480852, 0.7191328 ],\n",
" [0.29319575, 0.84587892, 0.43774675, 0.23388257, 0.92403114],\n",
" [0.96647025, 0.35831978, 0.8780017 , 0.18066205, 0.85001627],\n",
" [0.93969352, 0.53751407, 0.35651024, 0.52651873, 0.53328941]])"
]
},
"execution_count": 13,
Expand Down Expand Up @@ -383,7 +383,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[Feature{name='input-0', type=number, value=0.49418369920147376}, Feature{name='input-1', type=number, value=0.541389237195627}, Feature{name='input-2', type=number, value=0.79744718322189}, Feature{name='input-3', type=number, value=0.7596647445704917}]\n"
"[Feature{name='input-0', type=number, value=0.6846801847772033}, Feature{name='input-1', type=number, value=0.6070370508287989}, Feature{name='input-2', type=number, value=0.7619673021775413}, Feature{name='input-3', type=number, value=0.5664971655888972}]\n"
]
}
],
Expand All @@ -401,7 +401,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[Output{value=0.6663965038979389, type=number, score=1.0, name='output-0'}]\n"
"[Output{value=0.7213026353546987, type=number, score=1.0, name='output-0'}]\n"
]
}
],
Expand Down Expand Up @@ -437,7 +437,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[Feature{name='input-0', type=number, value=0.541389237195627}, Feature{name='input-1', type=number, value=0.7596647445704917}, Feature{name='input-2', type=number, value=0.6663965038979389}]\n"
"[Feature{name='input-0', type=number, value=0.6070370508287989}, Feature{name='input-1', type=number, value=0.5664971655888972}, Feature{name='input-2', type=number, value=0.7213026353546987}]\n"
]
}
],
Expand All @@ -455,26 +455,18 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[Output{value=0.49418369920147376, type=number, score=1.0, name='output-0'}, Output{value=0.79744718322189, type=number, score=1.0, name='output-1'}]\n"
"[Output{value=0.6846801847772033, type=number, score=1.0, name='output-0'}, Output{value=0.7619673021775413, type=number, score=1.0, name='output-1'}]\n"
]
}
],
"source": [
"print(ds.outputs[0].outputs)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "169523a6",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -488,7 +480,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.0"
"version": "3.11.7"
},
"toc": {
"base_numbering": 1,
Expand Down
359 changes: 190 additions & 169 deletions examples/EnergyLoadForecasting.ipynb

Large diffs are not rendered by default.

441 changes: 227 additions & 214 deletions examples/EngineFaultDetection.ipynb

Large diffs are not rendered by default.

16 changes: 4 additions & 12 deletions examples/GroupFairnessMetrics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -645,9 +645,9 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/rui/.virtualenvs/trustyai-explainability-python-examples/lib/python3.10/site-packages/xgboost/compat.py:31: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.\n",
"/home/rui/.virtualenvs/trustyai-explainability-python-examples/lib/python3.11/site-packages/xgboost/compat.py:31: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.\n",
" from pandas import MultiIndex, Int64Index\n",
"/Users/rui/.virtualenvs/trustyai-explainability-python-examples/lib/python3.10/site-packages/xgboost/data.py:208: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.\n",
"/home/rui/.virtualenvs/trustyai-explainability-python-examples/lib/python3.11/site-packages/xgboost/data.py:208: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.\n",
" from pandas import MultiIndex, Int64Index\n"
]
}
Expand Down Expand Up @@ -770,19 +770,11 @@
" positive_class=[1])\n",
"print(score)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ad3d2363",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -796,7 +788,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.0"
"version": "3.11.7"
}
},
"nbformat": 4,
Expand Down
313 changes: 313 additions & 0 deletions examples/LanguageMetrics.ipynb

Large diffs are not rendered by default.

Loading