pd_pr_analysis.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:palladio 作者: slipguru 项目源码 文件源码
def make_curve(x, y, xlabel, ylabel, filename):
    """Draw and save ROC or PR curves."""
    auc = np.trapz(x, y, dx=0.001)  # area under the curve

    sns.plt.figure()
    sns.plt.clf()
    sns.plt.plot(x, y)
    sns.plt.xlim([0, 1])
    sns.plt.ylim([0, 1])
    sns.plt.xlabel(xlabel)
    sns.plt.ylabel(ylabel)
    sns.plt.title("AUC: {}".format(auc))
    sns.plt.savefig(filename)

    return auc
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号