def measure_correlation(gold0, gold1, l = 10, pos = 0, list_w = []):
a = []
b = []
for w in gold0.keys():
if w in gold1 and (w in list_w or list_w == []):
if gold0[w][0] != None and gold1[w][0] != None:
if gold0[w][2] > l and gold1[w][2] > l:
if pos == 0:
a.append(logit(gold0[w][pos]))
b.append(logit(gold1[w][pos]))
else:
a.append(logit(1 - gold0[w][pos]))
b.append(logit(1 - gold1[w][pos]))
print len(a), np.mean(a), np.mean(b)
return np.cov(a,b)
评论列表
文章目录