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

recommendationEngine.js in "solution" branch calculates "total" incorrectly in calculateAgreement and calculateDisagreement #2

Open
Zerim opened this issue Nov 24, 2015 · 0 comments

Comments

@Zerim
Copy link
Contributor

Zerim commented Nov 24, 2015

In the "solution" branch, the "total" variable is calculated incorrectly here:

var total = agreements + symmetricDifference(user1.likes, user2.likes).length + symmetricDifference(user1.dislikes, user2.dislikes).length

and here:

var total = disagreements + symmetricDifference(user1.likes, user2.dislikes).length + symmetricDifference(user1.dislikes, user2.likes).length

var total = agreements + symmetricDifference(user1.likes, user2.likes).length + symmetricDifference(user1.dislikes, user2.dislikes).length

...will double-count certain movies in the case where one user likes some of the movies that the other user dislikes.

The same applies for...

var total = disagreements + symmetricDifference(user1.likes, user2.dislikes).length + symmetricDifference(user1.dislikes, user2.likes).length

...when one user likes some of the same movies as the other user.

This causes the final value to be returned by both functions and fed into calculateSimilarity to be incorrect.

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