{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Table 7: Accuracy on 32x32 flowpic when enlarging the training set (w/o Dropout)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[:simple-jupyter: :material-download:](/papers/imc23/notebooks/table7_larger_trainset.ipynb)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2023-09-04T06:53:14.186896Z", "iopub.status.busy": "2023-09-04T06:53:14.186585Z", "iopub.status.idle": "2023-09-04T06:53:14.789652Z", "shell.execute_reply": "2023-09-04T06:53:14.788718Z", "shell.execute_reply.started": "2023-09-04T06:53:14.186863Z" } }, "outputs": [], "source": [ "import itertools\n", "import pathlib\n", "\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2023-09-04T06:53:14.792072Z", "iopub.status.busy": "2023-09-04T06:53:14.791365Z", "iopub.status.idle": "2023-09-04T06:53:14.796485Z", "shell.execute_reply": "2023-09-04T06:53:14.795676Z", "shell.execute_reply.started": "2023-09-04T06:53:14.792042Z" } }, "outputs": [], "source": [ "RENAME = {\n", " \"noaug\": \"No augmentation\",\n", " \"rotate\": \"Rotate\",\n", " \"horizontalflip\": \"Horizontal flip\",\n", " \"colorjitter\": \"Color jitter\",\n", " \"packetloss\": \"Packet loss\",\n", " \"timeshift\": \"Time shift\",\n", " \"changertt\": \"Change RTT\",\n", "}" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2023-09-04T06:53:14.798154Z", "iopub.status.busy": "2023-09-04T06:53:14.797600Z", "iopub.status.idle": "2023-09-04T06:53:14.805540Z", "shell.execute_reply": "2023-09-04T06:53:14.804735Z", "shell.execute_reply.started": "2023-09-04T06:53:14.798125Z" } }, "outputs": [], "source": [ "folder = pathlib.Path(\"campaigns/ucdavis-icdm19/larger-trainset/\")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2023-09-04T06:53:14.807977Z", "iopub.status.busy": "2023-09-04T06:53:14.807348Z", "iopub.status.idle": "2023-09-04T06:53:14.859944Z", "shell.execute_reply": "2023-09-04T06:53:14.859088Z", "shell.execute_reply.started": "2023-09-04T06:53:14.807947Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
test-scripttest-human
meanci95meanci95
No augmentation98.370.1972.950.96
Rotate98.470.2573.731.09
Horizontal flip98.200.1574.581.16
Color jitter98.630.2172.471.02
Packet loss98.630.1973.431.25
Time shift98.600.2273.251.17
Change RTT98.330.1672.471.04
\n", "
" ], "text/plain": [ " test-script test-human \n", " mean ci95 mean ci95\n", " \n", "No augmentation 98.37 0.19 72.95 0.96\n", "Rotate 98.47 0.25 73.73 1.09\n", "Horizontal flip 98.20 0.15 74.58 1.16\n", "Color jitter 98.63 0.21 72.47 1.02\n", "Packet loss 98.63 0.19 73.43 1.25\n", "Time shift 98.60 0.22 73.25 1.17\n", "Change RTT 98.33 0.16 72.47 1.04" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_sup = pd.read_csv(\n", " folder\n", " / \"augmentation-at-loading/campaign_summary/augment-at-loading-larger-trainset/summary_flowpic_dim_32.csv\",\n", " header=[0, 1],\n", " index_col=[0, 1],\n", ")\n", "df_sup = df_sup[\"acc\"][[\"mean\", \"ci95\"]]\n", "df_sup.index.set_names([\"test_split_name\", \"aug_name\"], inplace=True)\n", "df_sup = df_sup.reset_index().pivot(\n", " columns=[\"test_split_name\"], index=\"aug_name\", values=[\"mean\", \"ci95\"]\n", ")\n", "df_sup.columns.set_names([\"stat\", \"test_split_name\"], inplace=True)\n", "df_sup = df_sup.reorder_levels([\"test_split_name\", \"stat\"], axis=1)\n", "df_sup = df_sup[\n", " list(itertools.product([\"test-script\", \"test-human\"], [\"mean\", \"ci95\"]))\n", "]\n", "df_sup = df_sup.rename(RENAME, axis=0).rename(RENAME, axis=1)\n", "df_sup.index.set_names([\"\"], inplace=True)\n", "df_sup.columns.set_names([\"\", \"\"], inplace=True)\n", "df_sup = df_sup.round(2)\n", "df_sup = df_sup.loc[list(RENAME.values())]\n", "df_sup.to_csv(\"table7_larger-trainset_augment-at-loading.csv\")\n", "df_sup" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "execution": { "iopub.execute_input": "2023-09-04T06:59:05.568896Z", "iopub.status.busy": "2023-09-04T06:59:05.568520Z", "iopub.status.idle": "2023-09-04T06:59:05.589545Z", "shell.execute_reply": "2023-09-04T06:59:05.588775Z", "shell.execute_reply.started": "2023-09-04T06:59:05.568865Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
meanci95
test-script93.900.74
test-human80.452.37
\n", "
" ], "text/plain": [ " mean ci95\n", "test-script 93.90 0.74\n", "test-human 80.45 2.37" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_cl = pd.read_csv(\n", " folder\n", " / \"simclr/campaign_summary/simclr-larger-trainset/summary_flowpic_dim_32.csv\",\n", " header=[0, 1],\n", " index_col=[0, 1],\n", ")\n", "df_cl = df_cl[\"acc\"][[\"mean\", \"ci95\"]]\n", "df_cl = df_cl.droplevel(1, axis=0).round(2)\n", "df_cl = df_cl.loc[[\"test-script\", \"test-human\"]]\n", "df_cl.to_csv(\"table7_larger-trainset_simclr.csv\")\n", "df_cl" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.11" } }, "nbformat": 4, "nbformat_minor": 4 }