Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calcSimlaryCosDist #2

Open
CoderXingZhang opened this issue Jan 4, 2018 · 0 comments
Open

calcSimlaryCosDist #2

CoderXingZhang opened this issue Jan 4, 2018 · 0 comments

Comments

@CoderXingZhang
Copy link

CoderXingZhang commented Jan 4, 2018

for key1 in user1:
    for key2 in user2:
        if key1[0] == key2[0]:  
            sum_xy +=(key1[1] - avg_x) * (key2[1] - avg_y)
            sum_y +=(key2[1] - avg_y) * (key2[1] -avg_y)
            sum_x +=(key1[1] - avg_x) * (key1[1] - avg_x)
if sum_xy == 0.0:
    return 0
sx_sy=math.sqrt(sum_x) * math.sqrt(sum_y)

这个函数里面的相似度计算应该是这样吧, userFC.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant