active.py 文件源码

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

项目:code-uai16 作者: thanhan 项目源码 文件源码
def al_crowd_fin_expert(adata, clf, turk_uncer, crowd_budget = 5*1500):
    if adata.spent_crowd < crowd_budget and len(adata.rel) > 0:
        res = al_just_crowd(adata, clf)
        if res != -1: return res

    print "q expert"
    n = len(adata.taken_items)
    crowd_prob = np.zeros(n)
    found = False
    for i in range(n):
        if not adata.expert_fixed[i]:
            found = True
            j = adata.taken_items[i]
            crowd_prob[i] = turk_uncer[j][0] *1.0/ (turk_uncer[j][0] + turk_uncer[j][1])
        else:
            crowd_prob[i] = 100

    if not found: return -1

    uncertain = np.abs(crowd_prob - 0.5)
    i = np.argmin(uncertain)

    #print i, adata.expert_fixed[i]
    print "most", turk_uncer[adata.taken_items[i]]
    return adata.query_expert_fix(i)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号