chrom_hmm_cnn.py 文件源码

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

项目:dsde-deep-learning 作者: broadinstitute 项目源码 文件源码
def get_fpr_tpr_roc(model, test_data, test_truth, labels):
    y_pred = model.predict(test_data, batch_size=32, verbose=0)

    # Compute ROC curve and ROC area for each class
    fpr = dict()
    tpr = dict()
    roc_auc = dict()
    for k in labels.keys():
        cur_idx = labels[k]
        fpr[labels[k]], tpr[labels[k]], _ = roc_curve(test_truth[:,cur_idx], y_pred[:,cur_idx])
        roc_auc[labels[k]] = auc(fpr[labels[k]], tpr[labels[k]])

    # Compute micro-average ROC curve and ROC area
    fpr["micro"], tpr["micro"], _ = roc_curve(test_truth.ravel(), y_pred.ravel())
    roc_auc["micro"] = auc(fpr["micro"], tpr["micro"])
    return fpr, tpr, roc_auc
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号