gzoo.py 文件源码

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

项目:code-uai16 作者: thanhan 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号