Skip to content

Commit ce0a25c

Browse files
committed
Visualize AUC results using bar plots
1 parent 239e964 commit ce0a25c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

notebooks/04_bias_analysis.ipynb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,33 @@
11641164
"\n",
11651165
"summary\n"
11661166
]
1167+
},
1168+
{
1169+
"cell_type": "code",
1170+
"execution_count": null,
1171+
"id": "9c318890",
1172+
"metadata": {},
1173+
"outputs": [],
1174+
"source": [
1175+
"# Visualize AUC results using bar plots\n",
1176+
"\n",
1177+
"import matplotlib.pyplot as plt\n",
1178+
"\n",
1179+
"def plot_slice_auc(title, auc_dict):\n",
1180+
" keys = list(auc_dict.keys())\n",
1181+
" values = list(auc_dict.values())\n",
1182+
"\n",
1183+
" plt.figure(figsize=(6,4))\n",
1184+
" plt.bar(keys, values, color=[\"#6c757d\",\"#0d6efd\",\"#198754\"])\n",
1185+
" plt.ylabel(\"AUC\")\n",
1186+
" plt.title(title)\n",
1187+
" plt.ylim(0,1)\n",
1188+
" plt.show()\n",
1189+
"\n",
1190+
"plot_slice_auc(\"AUC by Brightness Slice\", auc_brightness)\n",
1191+
"plot_slice_auc(\"AUC by Resolution Slice\", auc_resolution)\n",
1192+
"plot_slice_auc(\"AUC by Confidence Bucket\", auc_confidence)\n"
1193+
]
11671194
}
11681195
],
11691196
"metadata": {

0 commit comments

Comments
 (0)