kmeans.py 文件源码

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

项目:PPRE 作者: MaoYuwei 项目源码 文件源码
def PatPatSimilarity(p, c):
    #??bet??????

    #?????
    # print 'p', p
    # print 'c', c
    # print 'p len ', len(p)
    # print 'c len ', len(c[1])
    A = np.mat(p[1:])
    B = np.mat(c[1:])
    # A = np.mat(p)
    # B = np.mat(c[1])

    num = A * B.T
    denom = np.linalg.norm(A) * np.linalg.norm(B)
    cos = num / denom  # ???
    # sim = 0.5 + 0.5 * cos  # ???
    return cos
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号