0
$\begingroup$

I have a theoretical question. I have implemented a recommender system using collaborative filtering method. There, I am using cosine similarity method to calculate similarity between two users. I have user-item ratings matrix and I get two raws(user feature vectors) and calculate cosine similarity. As an example consider following example vectors.

a = [0 0 0 1 0]
b = [0 0 0 0 0]

If I use cosine similarity, I am getting large value for these users as most of the items haven't been rated by both users. So my question is, is it correct to consider having unrated items as similarity between users? IMO, there is no point of using unrated item's ratings to calculate similarity as it is misleading.

What is your idea about this issue? Is any remedy for this issue ?

$\endgroup$
  • 1
    $\begingroup$ When computing the similarity, only the item that rated by both users are under consideration. $\endgroup$ – Ben Dai Mar 28 '17 at 16:53
0
$\begingroup$

You only need to consider the set of items that have been rated by both the users, and compute the similarity using those.

Let that set be $I_{a,b}$. Then,

$sim_{a,b} = \sum_{i \in I_{a,b}} a_i b_i$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.