def compare_r2(results, results_real_card, results_random_sampling=None, exp=True):
    data_size = results['data_size']
    if exp:
        test_scores_real = results_real_card['test_scores_exp']
        test_scores = results['test_scores_exp']
    else:
        test_scores_real = results_real_card['test_scores']
        test_scores = results['test_scores']
    (fig, ax) = plt.subplots(figsize=(8, 2))
    if results_random_sampling:
        if exp:
            test_scores_random = results_random_sampling['test_scores_exp']
        else:
            test_scores_random = results_random_sampling['test_scores']
        ax.plot(list(map((lambda x: x['r2']), test_scores_random)), marker='^', linestyle='dotted', label='Rand. samples - Estimated out card. (Baseline)', color=sns.color_palette()[(- 4)])
    ax.plot(list(map((lambda x: x['r2']), test_scores)), marker='o', label='Active labeling - Estimated out card.', color='#111111')
    ax.plot(list(map((lambda x: x['r2']), test_scores_real)), linestyle='--', marker='s', label='Active labeling - Real out card. (Top-line)', color=sns.color_palette()[(- 3)], alpha=0.85)
    ax.set_xticks(list(range(data_size.__len__())))
    ax.set_xticklabels(data_size, rotation=60)
    ax.set_ylim((0, 1))
    ax.set_yticks(np.arange(0, 1, 0.2))
    ax.set_xlabel('# Cumulated Executed Jobs')
    ax.set_ylabel('$R^2$ of pred.\nExec. Time')
    ax.legend()
    return ax
def compare_r2(results, results_real_card, results_random_sampling=None, exp=True):
    data_size = results['data_size']
    if exp:
        test_scores_real = results_real_card['test_scores_exp']
        test_scores = results['test_scores_exp']
    else:
        test_scores_real = results_real_card['test_scores']
        test_scores = results['test_scores']
    (fig, ax) = plt.subplots(figsize=(8, 2))
    if results_random_sampling:
        if exp:
            test_scores_random = results_random_sampling['test_scores_exp']
        else:
            test_scores_random = results_random_sampling['test_scores']
        ax.plot(list(map((lambda x: x['r2']), test_scores_random)), marker='^', linestyle='dotted', label='Rand. samples - Estimated out card. (Baseline)', color=sns.color_palette()[(- 4)])
    ax.plot(list(map((lambda x: x['r2']), test_scores)), marker='o', label='Active labeling - Estimated out card.', color='#111111')
    ax.plot(list(map((lambda x: x['r2']), test_scores_real)), linestyle='--', marker='s', label='Active labeling - Real out card. (Top-line)', color=sns.color_palette()[(- 3)], alpha=0.85)
    ax.set_xticks(list(range(data_size.__len__())))
    ax.set_xticklabels(data_size, rotation=60)
    ax.set_ylim((0, 1))
    ax.set_yticks(np.arange(0, 1, 0.2))
    ax.set_xlabel('# Cumulated Executed Jobs')
    ax.set_ylabel('$R^2$ of pred.\nExec. Time')
    ax.legend()
    return ax