Skip to content

Commit c184d5e

Browse files
committed
Rename index levels
1 parent 441ccc8 commit c184d5e

9 files changed

Lines changed: 180 additions & 172 deletions

reproducibility/generate_summary_table.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ def generate_results_table(with_std: bool, midrule_between_models: bool = True):
8181
wide_summary_df = reorganize_summary_df(all_results_tall_df, with_std=with_std)
8282
wide_summary_df = wide_summary_df.applymap(lambda v: ('$' + v + '$') if v != '' else '')
8383

84+
translation = dict(
85+
pub='pub',
86+
avg='R',
87+
best='O',
88+
worst='P',
89+
)
90+
wide_summary_df = wide_summary_df.reindex(wide_summary_df.index.set_levels([translation[k] for k in wide_summary_df.index.levels[1]], level=1))
91+
8492
# Save as Latex table
8593
pd.set_option('max_colwidth', 999)
8694
table_latex = wide_summary_df.to_latex(
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
\begin{tabular}{llrrrrrrr}
22
\toprule
3-
& & MRR (\%) & Hits@1 (\%) & Hits@3 (\%) & Hits@5 (\%) & Hits@10 (\%) & MR & AMR (\%) \\
4-
\textbf{model} & {} & & & & & & & \\
3+
& & MRR (\%) & Hits@1 (\%) & Hits@3 (\%) & Hits@5 (\%) & Hits@10 (\%) & MR & AMR (\%) \\
4+
\textbf{model} & {} & & & & & & & \\
55
\midrule
6-
\textbf{ConvE} & \textbf{pub} & $32.5\phantom{0 \pm 0.00}$ & $23.7\phantom{0 \pm 0.00}$ & $35.6\phantom{0 \pm 0.00}$ & & $50.1\phantom{0 \pm 0.00}$ & $\phantom{0}244.\phantom{00 \pm 00.00}$ & \\
7-
& \textbf{avg} & $26.93 \pm 0.11$ & $18.22 \pm 0.11$ & $29.51 \pm 0.24$ & $35.98 \pm 0.16$ & $44.95 \pm 0.17$ & $\phantom{0}255.46 \pm \phantom{0}6.16$ & $\phantom{0}3.73 \pm 0.13$ \\\midrule
8-
\textbf{ConvKB} & \textbf{pub} & $39.6\phantom{0 \pm 0.00}$ & & & & $51.7\phantom{0 \pm 0.00}$ & $\phantom{0}257.\phantom{00 \pm 00.00}$ & \\
9-
& \textbf{avg} & $\phantom{0}4.71 \pm 0.23$ & $\phantom{0}3.31 \pm 0.23$ & $\phantom{0}4.04 \pm 0.19$ & $\phantom{0}4.57 \pm 0.22$ & $\phantom{0}7.76 \pm 0.88$ & $4345.27 \pm 46.99$ & $61.36 \pm 0.65$ \\\midrule
10-
\textbf{RotatE} & \textbf{pub} & $33.8\phantom{0 \pm 0.00}$ & $24.1\phantom{0 \pm 0.00}$ & $37.5\phantom{0 \pm 0.00}$ & & $53.3\phantom{0 \pm 0.00}$ & $\phantom{0}177.\phantom{00 \pm 00.00}$ & \\
11-
& \textbf{avg} & $26.42 \pm 0.04$ & $17.57 \pm 0.06$ & $28.97 \pm 0.05$ & $35.29 \pm 0.09$ & $44.55 \pm 0.06$ & $\phantom{0}191.92 \pm \phantom{0}0.31$ & $\phantom{0}2.84 \pm 0.00$ \\
6+
\textbf{ConvE} & \textbf{pub} & $32.5\phantom{0 \pm 0.00}$ & $23.7\phantom{0 \pm 0.00}$ & $35.6\phantom{0 \pm 0.00}$ & & $50.1\phantom{0 \pm 0.00}$ & $\phantom{0}244.\phantom{00 \pm 00.00}$ & \\
7+
& \textbf{R} & NaN & NaN & NaN & NaN & NaN & NaN & NaN \\\midrule
8+
\textbf{ConvKB} & \textbf{pub} & $39.6\phantom{0 \pm 0.00}$ & & & & $51.7\phantom{0 \pm 0.00}$ & $\phantom{0}257.\phantom{00 \pm 00.00}$ & \\
9+
& \textbf{R} & NaN & NaN & NaN & NaN & NaN & NaN & NaN \\\midrule
10+
\textbf{RotatE} & \textbf{pub} & $33.8\phantom{0 \pm 0.00}$ & $24.1\phantom{0 \pm 0.00}$ & $37.5\phantom{0 \pm 0.00}$ & & $53.3\phantom{0 \pm 0.00}$ & $\phantom{0}177.\phantom{00 \pm 00.00}$ & \\
11+
& \textbf{R} & NaN & NaN & NaN & NaN & NaN & NaN & NaN \\
1212
\bottomrule
1313
\end{tabular}
1414

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
\begin{tabular}{llrrrrrrr}
22
\toprule
3-
& & MRR (\%) & Hits@1 (\%) & Hits@3 (\%) & Hits@5 (\%) & Hits@10 (\%) & MR & AMR (\%) \\
4-
\textbf{model} & {} & & & & & & & \\
3+
& & MRR (\%) & Hits@1 (\%) & Hits@3 (\%) & Hits@5 (\%) & Hits@10 (\%) & MR & AMR (\%) \\
4+
\textbf{model} & {} & & & & & & & \\
55
\midrule
6-
\textbf{ConvE} & \textbf{pub} & $32.5\phantom{0}$ & $23.7\phantom{0}$ & $35.6\phantom{0}$ & & $50.1\phantom{0}$ & $\phantom{0}244.\phantom{00}$ & \\
7-
& \textbf{avg} & $26.93$ & $18.22$ & $29.51$ & $35.98$ & $44.95$ & $\phantom{0}255.46$ & $\phantom{0}3.73$ \\\midrule
8-
\textbf{ConvKB} & \textbf{pub} & $39.6\phantom{0}$ & & & & $51.7\phantom{0}$ & $\phantom{0}257.\phantom{00}$ & \\
9-
& \textbf{avg} & $\phantom{0}4.71$ & $\phantom{0}3.31$ & $\phantom{0}4.04$ & $\phantom{0}4.57$ & $\phantom{0}7.76$ & $4345.27$ & $61.36$ \\\midrule
10-
\textbf{RotatE} & \textbf{pub} & $33.8\phantom{0}$ & $24.1\phantom{0}$ & $37.5\phantom{0}$ & & $53.3\phantom{0}$ & $\phantom{0}177.\phantom{00}$ & \\
11-
& \textbf{avg} & $26.42$ & $17.57$ & $28.97$ & $35.29$ & $44.55$ & $\phantom{0}191.92$ & $\phantom{0}2.84$ \\
6+
\textbf{ConvE} & \textbf{pub} & $32.5\phantom{0}$ & $23.7\phantom{0}$ & $35.6\phantom{0}$ & & $50.1\phantom{0}$ & $\phantom{0}244.\phantom{00}$ & \\
7+
& \textbf{R} & NaN & NaN & NaN & NaN & NaN & NaN & NaN \\\midrule
8+
\textbf{ConvKB} & \textbf{pub} & $39.6\phantom{0}$ & & & & $51.7\phantom{0}$ & $\phantom{0}257.\phantom{00}$ & \\
9+
& \textbf{R} & NaN & NaN & NaN & NaN & NaN & NaN & NaN \\\midrule
10+
\textbf{RotatE} & \textbf{pub} & $33.8\phantom{0}$ & $24.1\phantom{0}$ & $37.5\phantom{0}$ & & $53.3\phantom{0}$ & $\phantom{0}177.\phantom{00}$ & \\
11+
& \textbf{R} & NaN & NaN & NaN & NaN & NaN & NaN & NaN \\
1212
\bottomrule
1313
\end{tabular}
1414

0 commit comments

Comments
 (0)