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]
评论列表
文章目录