Skip to content

Table 6: Comparing the fine-tuning performance when using different pairs of augmentation for pretraining.

import itertools

import pandas as pd
RENAME = {
    "colorjitter": "Color jitter",
    "timeshift": "Time shift",
    "changertt": "Change RTT",
    "rotate": "Rotate",
    "packetloss": "Packet loss",
}
df = pd.read_csv(
    "./campaigns/ucdavis-icdm19/simclr-other-augmentation-pairs/campaign_summary/simclr-other-augmentation-pairs/summary_flowpic_dim_32.csv",
    header=[0, 1],
    index_col=[0, 1],
)

df = df["acc"][["mean", "ci95"]].round(2)
df = df.reset_index()
df = df.assign(
    aug1=df["level_1"].apply(eval).str[0],
    aug2=df["level_1"].apply(eval).str[1],
)
df = df.drop("level_1", axis=1)
df = df.rename({"level_0": "test_split_name"}, axis=1)
df = df.replace(RENAME)
df = df.pivot(index="test_split_name", columns=["aug1", "aug2"])
df.columns.set_names(["stat", "aug1", "aug2"], inplace=True)
df = df.reorder_levels(["aug1", "aug2", "stat"], axis=1)
df.columns.set_names(["", "", ""], inplace=True)
df.index.name = None

df = df[
    list(itertools.product(["Change RTT"], ["Time shift"], ["mean", "ci95"]))
    + list(
        itertools.product(["Packet loss"], ["Color jitter", "Rotate"], ["mean", "ci95"])
    )
    + list(
        itertools.product(["Change RTT"], ["Color jitter", "Rotate"], ["mean", "ci95"])
    )
    + list(itertools.product(["Color jitter"], ["Rotate"], ["mean", "ci95"]))
]
df = df.loc[["test-script", "test-human"]]

df.to_csv("table5_simclr_other_augmentation_pairs.csv")
df
Change RTT Packet loss Change RTT Color jitter
Time shift Color jitter Rotate Color jitter Rotate Rotate
mean ci95 mean ci95 mean ci95 mean ci95 mean ci95 mean ci95
test-script 92.18 0.31 90.17 0.41 91.94 0.3 91.72 0.36 92.38 0.32 91.79 0.34
test-human 74.69 1.13 73.67 1.24 71.22 1.2 75.56 1.23 74.33 1.26 71.64 1.23