toolbox.py 文件源码

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

项目:segmenter 作者: yanshao9798 项目源码 文件源码
def biased_out(prediction, bias):
    out = []
    b_pres = []
    for pre in prediction:
        b_pres.append(pre[:,0] - pre[:,1])
    props = np.concatenate(b_pres)
    props = np.sort(props)[::-1]
    idx = int(bias*len(props))
    if idx == len(props):
        idx -= 1
    th = props[idx]
    print 'threshold: ', th, 1 / (1 + np.exp(-th))
    for pre in b_pres:
        pre[pre >= th] = 0
        pre[pre != 0] = 1
        out.append(pre)
    return out
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号