evaluation.py 文件源码

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

项目:single-cell-classification 作者: whuTommy 项目源码 文件源码
def optimize_threshold_with_prc(prc, thresholds, criterion='min'):
    prc[np.isnan(prc)] = 0
    if prc.shape[1] > prc.shape[0]:
        prc = prc.T
    assert(prc.shape[0] == thresholds.shape[0])
    if criterion == 'sum':
        scores = prc.sum(axis=1)
    elif criterion.startswith('dist'):
        scores = -cdist(np.array([[1,1]]), prc)
    else:
        scores = prc.min(axis=1)
    ti = np.nanargmax(scores)
    return thresholds[ti], ti
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号