Skip to content

Commit

Permalink
Rename index levels
Browse files Browse the repository at this point in the history
  • Loading branch information
mberr committed Jun 22, 2020
1 parent 441ccc8 commit c184d5e
Show file tree
Hide file tree
Showing 9 changed files with 180 additions and 172 deletions.
8 changes: 8 additions & 0 deletions reproducibility/generate_summary_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ def generate_results_table(with_std: bool, midrule_between_models: bool = True):
wide_summary_df = reorganize_summary_df(all_results_tall_df, with_std=with_std)
wide_summary_df = wide_summary_df.applymap(lambda v: ('$' + v + '$') if v != '' else '')

translation = dict(
pub='pub',
avg='R',
best='O',
worst='P',
)
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))

This comment has been minimized.

Copy link
@mali-git

mali-git Jun 22, 2020

Member

@mberr when replacing k with translation[k], the wide_summary_df will contains NaNs

This comment has been minimized.

Copy link
@mali-git

mali-git Jun 22, 2020

Member

Somewhere the mapping is not done. I have to figure out where :D

This comment has been minimized.

Copy link
@mberr

mberr Jun 22, 2020

Author Member

@mali-git should be solved in the latest commit,
ef1512d


# Save as Latex table
pd.set_option('max_colwidth', 999)
table_latex = wide_summary_df.to_latex(
Expand Down
16 changes: 8 additions & 8 deletions reproducibility/summaries/fb15k237_table.tex
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
\begin{tabular}{llrrrrrrr}
\toprule
& & MRR (\%) & Hits@1 (\%) & Hits@3 (\%) & Hits@5 (\%) & Hits@10 (\%) & MR & AMR (\%) \\
\textbf{model} & {} & & & & & & & \\
& & MRR (\%) & Hits@1 (\%) & Hits@3 (\%) & Hits@5 (\%) & Hits@10 (\%) & MR & AMR (\%) \\
\textbf{model} & {} & & & & & & & \\
\midrule
\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}$ & \\
& \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
\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}$ & \\
& \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
\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}$ & \\
& \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$ \\
\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}$ & \\
& \textbf{R} & NaN & NaN & NaN & NaN & NaN & NaN & NaN \\\midrule
\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}$ & \\
& \textbf{R} & NaN & NaN & NaN & NaN & NaN & NaN & NaN \\\midrule
\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}$ & \\
& \textbf{R} & NaN & NaN & NaN & NaN & NaN & NaN & NaN \\
\bottomrule
\end{tabular}

16 changes: 8 additions & 8 deletions reproducibility/summaries/fb15k237_table_without_std.tex
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
\begin{tabular}{llrrrrrrr}
\toprule
& & MRR (\%) & Hits@1 (\%) & Hits@3 (\%) & Hits@5 (\%) & Hits@10 (\%) & MR & AMR (\%) \\
\textbf{model} & {} & & & & & & & \\
& & MRR (\%) & Hits@1 (\%) & Hits@3 (\%) & Hits@5 (\%) & Hits@10 (\%) & MR & AMR (\%) \\
\textbf{model} & {} & & & & & & & \\
\midrule
\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}$ & \\
& \textbf{avg} & $26.93$ & $18.22$ & $29.51$ & $35.98$ & $44.95$ & $\phantom{0}255.46$ & $\phantom{0}3.73$ \\\midrule
\textbf{ConvKB} & \textbf{pub} & $39.6\phantom{0}$ & & & & $51.7\phantom{0}$ & $\phantom{0}257.\phantom{00}$ & \\
& \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
\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}$ & \\
& \textbf{avg} & $26.42$ & $17.57$ & $28.97$ & $35.29$ & $44.55$ & $\phantom{0}191.92$ & $\phantom{0}2.84$ \\
\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}$ & \\
& \textbf{R} & NaN & NaN & NaN & NaN & NaN & NaN & NaN \\\midrule
\textbf{ConvKB} & \textbf{pub} & $39.6\phantom{0}$ & & & & $51.7\phantom{0}$ & $\phantom{0}257.\phantom{00}$ & \\
& \textbf{R} & NaN & NaN & NaN & NaN & NaN & NaN & NaN \\\midrule
\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}$ & \\
& \textbf{R} & NaN & NaN & NaN & NaN & NaN & NaN & NaN \\
\bottomrule
\end{tabular}

Loading

0 comments on commit c184d5e

Please sign in to comment.