evaluation.py 文件源码

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

项目:single-cell-classification 作者: whuTommy 项目源码 文件源码
def optimize_threshold_with_f1(f1c, thresholds, criterion='max'):
    #f1c[np.isnan(f1c)] = 0
    if criterion == 'max':
        ti = np.nanargmax(f1c)
    else:
        ti = np.nanargmin(np.abs(thresholds-0.5*f1c))
        #assert(np.all(thresholds>=0))
        #idx = (thresholds>=f1c*0.5-mp) & (thresholds<=f1c*0.5+mp)
        #assert(np.any(idx))
        #ti = np.where(idx)[0][f1c[idx].argmax()]
    return thresholds[ti], ti
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号