Dealing with Pearson Similarity returning 0 for users with equal item counts - Mahout

24 views Asked by At

I'm currently working on a recommendation system that suggests items to users based on their purchase history. I'm using Pearson Similarity to measure the similarity between users' purchase patterns. However, I've encountered an issue where Pearson Similarity returns 0 for users who have purchased the same number of items. This happens because the standard deviation of both users' purchase counts becomes 0, resulting in a division by zero error in the Pearson Similarity formula.

Here's an example of my data structure:

userId itemId purchaseCount
1 1 3
1 2 4
1 3 2
2 1 3
2 2 3
2 3 3

How can I address this issue and still use Pearson Similarity effectively in my recommendation system? Should I consider using a different similarity measure or modifying the Pearson Similarity formula to handle this scenario?

Any insights or suggestions would be greatly appreciated. Thank you!

0

There are 0 answers