I have a "User x Item" matrix as below:
user item1 item2 item3
u1 2 0 3
u2 1 2 0
u3 4 3 1
u4 0 2 2
I want to computer the similarity between items based on users. For example, to calculate similarity between items i1 and i2, I only choose users who have assigned values to both of these items.
The cosine similarity between two items (i1 and i2) is as follows:
cos(v1,v2) = (1*2 + 4*3)/sqrt[(1 + 4)*(16+9)]
My question is for item-to-item similarity, should I consider all users, or just common users who assigned values to the items?