def show_td_gen(results, iteration_to_show):
    y_test = results[list(results.keys())[iteration_to_show]]['test_labels']
    y_pred = results[list(results.keys())[iteration_to_show]]['pred_labels']
    from sklearn.metrics import r2_score
    score = r2_score(y_test, y_pred)
    print('R2 score:', score)
    p = y_test.argsort()
    (fig, ax) = plt.subplots(figsize=(6, 3))
    ax.plot(y_test[p], y_test[p], marker='.', linewidth=1, label='Real', color='#777777', alpha=0.5)
    ax.plot(y_test[p], y_pred[p], marker='.', linewidth=0, label='TDGen Pred.', color=sns.color_palette()[4], alpha=0.5)
    ax.set_ylabel('Forecasted Exec. Time [ms] (Log scale)')
    ax.set_yscale('log')
    ax.set_xlabel('Real Exec. Time [ms] (Log scale)')
    ax.set_xscale('log')
    ax.legend()
    return ax
def show_td_gen(results, iteration_to_show):
    y_test = results[list(results.keys())[iteration_to_show]]['test_labels']
    y_pred = results[list(results.keys())[iteration_to_show]]['pred_labels']
    from sklearn.metrics import r2_score
    score = r2_score(y_test, y_pred)
    print('R2 score:', score)
    p = y_test.argsort()
    (fig, ax) = plt.subplots(figsize=(6, 3))
    ax.plot(y_test[p], y_test[p], marker='.', linewidth=1, label='Real', color='#777777', alpha=0.5)
    ax.plot(y_test[p], y_pred[p], marker='.', linewidth=0, label='TDGen Pred.', color=sns.color_palette()[4], alpha=0.5)
    ax.set_ylabel('Forecasted Exec. Time [ms] (Log scale)')
    ax.set_yscale('log')
    ax.set_xlabel('Real Exec. Time [ms] (Log scale)')
    ax.set_xscale('log')
    ax.legend()
    return ax