Skip to content

Table 7: Accuracy on 32x32 flowpic when enlarging the training set (w/o Dropout)

import itertools
import pathlib

import pandas as pd
RENAME = {
    "noaug": "No augmentation",
    "rotate": "Rotate",
    "horizontalflip": "Horizontal flip",
    "colorjitter": "Color jitter",
    "packetloss": "Packet loss",
    "timeshift": "Time shift",
    "changertt": "Change RTT",
}
folder = pathlib.Path("campaigns/ucdavis-icdm19/larger-trainset/")
df_sup = pd.read_csv(
    folder
    / "augmentation-at-loading/campaign_summary/augment-at-loading-larger-trainset/summary_flowpic_dim_32.csv",
    header=[0, 1],
    index_col=[0, 1],
)
df_sup = df_sup["acc"][["mean", "ci95"]]
df_sup.index.set_names(["test_split_name", "aug_name"], inplace=True)
df_sup = df_sup.reset_index().pivot(
    columns=["test_split_name"], index="aug_name", values=["mean", "ci95"]
)
df_sup.columns.set_names(["stat", "test_split_name"], inplace=True)
df_sup = df_sup.reorder_levels(["test_split_name", "stat"], axis=1)
df_sup = df_sup[
    list(itertools.product(["test-script", "test-human"], ["mean", "ci95"]))
]
df_sup = df_sup.rename(RENAME, axis=0).rename(RENAME, axis=1)
df_sup.index.set_names([""], inplace=True)
df_sup.columns.set_names(["", ""], inplace=True)
df_sup = df_sup.round(2)
df_sup = df_sup.loc[list(RENAME.values())]
df_sup.to_csv("table7_larger-trainset_augment-at-loading.csv")
df_sup
test-script test-human
mean ci95 mean ci95
No augmentation 98.37 0.19 72.95 0.96
Rotate 98.47 0.25 73.73 1.09
Horizontal flip 98.20 0.15 74.58 1.16
Color jitter 98.63 0.21 72.47 1.02
Packet loss 98.63 0.19 73.43 1.25
Time shift 98.60 0.22 73.25 1.17
Change RTT 98.33 0.16 72.47 1.04
df_cl = pd.read_csv(
    folder
    / "simclr/campaign_summary/simclr-larger-trainset/summary_flowpic_dim_32.csv",
    header=[0, 1],
    index_col=[0, 1],
)
df_cl = df_cl["acc"][["mean", "ci95"]]
df_cl = df_cl.droplevel(1, axis=0).round(2)
df_cl = df_cl.loc[["test-script", "test-human"]]
df_cl.to_csv("table7_larger-trainset_simclr.csv")
df_cl
mean ci95
test-script 93.90 0.74
test-human 80.45 2.37