| Conditions | 1 |
| Total Lines | 23 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from tqdm import tqdm |
||
| 7 | def create_performance_plots(study_name): |
||
| 8 | results = pd.read_csv("./_data/" + study_name + ".csv", index_col=0) |
||
| 9 | |||
| 10 | total_time = results.loc["total_time_mean"].values |
||
| 11 | eval_time = results.loc["eval_time_mean"].values |
||
| 12 | iter_time = results.loc["iter_time_mean"].values |
||
| 13 | |||
| 14 | ind = np.arange(total_time.shape[0]) # the x locations for the groups |
||
| 15 | width = 0.35 # the width of the bars: can also be len(x) sequence |
||
| 16 | |||
| 17 | plt.figure(figsize=(15, 5)) |
||
| 18 | |||
| 19 | p2 = plt.bar(ind, iter_time, width, bottom=eval_time) |
||
| 20 | p1 = plt.bar(ind, eval_time, width) |
||
| 21 | |||
| 22 | plt.ylabel("Time [s]") |
||
| 23 | # plt.title(title) |
||
| 24 | plt.xticks(ind, results.columns, rotation=75) |
||
| 25 | # plt.yticks() |
||
| 26 | plt.legend((p1[0], p2[0]), ("Eval time", "Opt time")) |
||
| 27 | |||
| 28 | plt.tight_layout() |
||
| 29 | plt.savefig("./_plots/performance.png", dpi=300) |
||
| 30 | |||
| 33 |