@@ -137,7 +137,7 @@ def get_all_folders(models, exclude) -> dict:
137
137
# function to get all the files under the model folder
138
138
def get_all_files (folder_path , dataset ) -> (str , str ):
139
139
yaml_path = str (Path (f"{ folder_path } " ) / f"*{ dataset } *.yaml" )
140
- req_path = str (Path (f"{ folder_path } " ) / f"*{ dataset } * .txt" )
140
+ req_path = str (Path (f"{ folder_path } " ) / f"*.txt" )
141
141
return glob .glob (yaml_path )[0 ], glob .glob (req_path )[0 ]
142
142
143
143
@@ -172,17 +172,17 @@ def get_all_results(folders) -> dict:
172
172
173
173
# function to generate and save markdown table
174
174
def gen_and_save_md_table (metrics , dataset ):
175
- table = "| Model Name | Dataset | Annualized Return | Information Ratio | Max Drawdown | IC | ICIR | Rank IC | Rank ICIR |\n "
175
+ table = "| Model Name | Dataset | IC | ICIR | Rank IC | Rank ICIR | Annualized Return | Information Ratio | Max Drawdown |\n "
176
176
table += "|---|---|---|---|---|---|---|---|---|\n "
177
177
for fn in metrics :
178
- ar = metrics [fn ]["annualized_return_with_cost" ]
179
- ir = metrics [fn ]["information_ratio_with_cost" ]
180
- md = metrics [fn ]["max_drawdown_with_cost" ]
181
178
ic = metrics [fn ]["ic" ]
182
179
icir = metrics [fn ]["icir" ]
183
180
ric = metrics [fn ]["rank_ic" ]
184
181
ricir = metrics [fn ]["rank_icir" ]
185
- table += f"| { fn } | { dataset } | { ar [0 ]:5.4f} ±{ ar [1 ]:2.2f} | { ir [0 ]:5.4f} ±{ ir [1 ]:2.2f} | { md [0 ]:5.4f} ±{ md [1 ]:2.2f} | { ic [0 ]:5.4f} ±{ ic [1 ]:2.2f} | { icir [0 ]:5.4f} ±{ icir [1 ]:2.2f} | { ric [0 ]:5.4f} ±{ ric [1 ]:2.2f} | { ricir [0 ]:5.4f} ±{ ricir [1 ]:2.2f} |\n "
182
+ ar = metrics [fn ]["annualized_return_with_cost" ]
183
+ ir = metrics [fn ]["information_ratio_with_cost" ]
184
+ md = metrics [fn ]["max_drawdown_with_cost" ]
185
+ table += f"| { fn } | { dataset } | { ic [0 ]:5.4f} ±{ ic [1 ]:2.2f} | { icir [0 ]:5.4f} ±{ icir [1 ]:2.2f} | { ric [0 ]:5.4f} ±{ ric [1 ]:2.2f} | { ricir [0 ]:5.4f} ±{ ricir [1 ]:2.2f} | { ar [0 ]:5.4f} ±{ ar [1 ]:2.2f} | { ir [0 ]:5.4f} ±{ ir [1 ]:2.2f} | { md [0 ]:5.4f} ±{ md [1 ]:2.2f} |\n "
186
186
pprint (table )
187
187
with open ("table.md" , "w" ) as f :
188
188
f .write (table )
0 commit comments