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