util.py 文件源码

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

项目:auckland-ai-meetup-x-triage 作者: a-i-joe 项目源码 文件源码
def plot_crossval_auc(roc_curves):
    cmap = sns.cubehelix_palette(11)
    aucs = []
    ax = plt.axes()
    for fold in roc_curves.keys():
        (f, p) = roc_curves[fold]
        aucs.append(area_under_curve(f, p))
        label_str = "fold {}, roc auc: {:.2f}".format(fold, aucs[-1])
        ax.plot(f, p, label=label_str, color=cmap[fold])
    ax.plot([0, 1], [0, 1], label="random, roc auc: 0.5", color="black")
    ax.legend(loc="lower right")
    plt.xlabel("False positive rate")
    plt.ylabel("True positive rate")
    plt.title(
        "ROC curves across 10 different validation folds(tiny convnet "
        "trained on small datasets)")
    plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号