active.py 文件源码

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

项目:code-uai16 作者: thanhan 项目源码 文件源码
def items_for_expert(adata, pp, n, flag):
    """
    take n items for expert to consider
    """
    combined_prob = 0.8*np.asarray(adata.taken_crowd_prob) + 0.2*pp[:,1]
    uncertain = np.abs(combined_prob - 0.5)

    if flag != None:
        addition = np.asarray(flag, dtype = int)*10# flagged items are not consider, increase their value
        uncertain = uncertain + addition

    if len(uncertain) <= n:
        return np.nonzero(uncertain <= 10000000)[0]

    sorted_uncertain = np.sort(uncertain)

    thresh = sorted_uncertain[n]
    return np.nonzero(uncertain <= thresh)[0]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号