Skip to content

Commit aab4402

Browse files
committed
Debugging Functions
1 parent d825cce commit aab4402

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

aeon/visualisation/results/_mcm.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,19 @@ def create_multi_comparison_matrix(
211211
include_legend=include_legend,
212212
show_symetry=show_symetry,
213213
)
214+
215+
def dict_to_latex(data_dict):
216+
lines = []
217+
lines.append(r"\begin{tabular}{|l|l|l|l|l|}")
218+
lines.append(r"\hline")
219+
lines.append(r"Comparison & Significant & Loss & Mean & p-value \\")
220+
lines.append(r"\hline")
221+
for key, values in data_dict.items():
222+
line = f"{key} & {values['is-significant']} & {values['loss']} & {values['mean']:.4f} & {values['pvalue']:.4f} \\\\"
223+
lines.append(line)
224+
lines.append(r"\hline")
225+
lines.append(r"\end{tabular}")
226+
return "\n".join(lines)
214227

215228
# Handle saving files if save_files dictionary is provided
216229
if save_files:
@@ -225,8 +238,8 @@ def create_multi_comparison_matrix(
225238
df_results.to_csv(save_path, index=False)
226239
elif file_type == "tex":
227240
with open(save_path, "w") as f:
228-
f.write(analysis.to_latex())
229-
241+
f.write(dict_to_latex(analysis))
242+
230243
return fig
231244

232245

0 commit comments

Comments
 (0)