File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
aeon/visualisation/results Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,19 @@ def create_multi_comparison_matrix(
211
211
include_legend = include_legend ,
212
212
show_symetry = show_symetry ,
213
213
)
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 )
214
227
215
228
# Handle saving files if save_files dictionary is provided
216
229
if save_files :
@@ -225,8 +238,8 @@ def create_multi_comparison_matrix(
225
238
df_results .to_csv (save_path , index = False )
226
239
elif file_type == "tex" :
227
240
with open (save_path , "w" ) as f :
228
- f .write (analysis . to_latex ( ))
229
-
241
+ f .write (dict_to_latex ( analysis ))
242
+
230
243
return fig
231
244
232
245
You can’t perform that action at this time.
0 commit comments