def plotPrecisionRecall(alg_pre_recDict, color_paletteList, tuple_size, path_name):
    colors = []
    for p in color_paletteList:
        for c in plt.get_cmap(p).colors:
            colors += [c]
    col = 0
    plt.figure(figsize=tuple_size)
    for al in alg_pre_recDict:
        recall = alg_pre_recDict[al]['recall']
        precision = alg_pre_recDict[al]['precision']
        average_precision = alg_pre_recDict[al]['average_precision']
        alg_name = alg_pre_recDict[al]['alg_name']
        "\n        plt.step(recall, precision, color=colors[col], alpha=0.8, where='post',                  label= alg_name + ' (area = %0.3f)'.format(average_precision))\n        "
        plt.plot(recall, precision, color=colors[col], alpha=0.8, label=(alg_name + (' (area = %0.3f)' % average_precision)))
        col += 1
    plt.xlabel('Recall')
    plt.ylabel('Precision')
    plt.ylim([0.0, 1.0])
    plt.xlim([0.0, 1.0])
    plt.legend(loc='upper right')
    plt.title('Precision-Recall curve for CLICKED')
    plt.savefig((path_name + '_PrecisionRecall.png'))
    plt.show()
def plotPrecisionRecall(alg_pre_recDict, color_paletteList, tuple_size, path_name):
    colors = []
    for p in color_paletteList:
        for c in plt.get_cmap(p).colors:
            colors += [c]
    col = 0
    plt.figure(figsize=tuple_size)
    for al in alg_pre_recDict:
        recall = alg_pre_recDict[al]['recall']
        precision = alg_pre_recDict[al]['precision']
        average_precision = alg_pre_recDict[al]['average_precision']
        alg_name = alg_pre_recDict[al]['alg_name']
        "\n        plt.step(recall, precision, color=colors[col], alpha=0.8, where='post',                  label= alg_name + ' (area = %0.3f)'.format(average_precision))\n        "
        plt.plot(recall, precision, color=colors[col], alpha=0.8, label=(alg_name + (' (area = %0.3f)' % average_precision)))
        col += 1
    plt.xlabel('Recall')
    plt.ylabel('Precision')
    plt.ylim([0.0, 1.0])
    plt.xlim([0.0, 1.0])
    plt.legend(loc='upper right')
    plt.title('Precision-Recall curve for CLICKED')
    plt.savefig((path_name + '_PrecisionRecall.png'))
    plt.show()