0

I have 2 users (u1 andu2) and they have rated for 2 movies (m1 and m2)

    m1     m2
u1   1     1
u2   5     5

when I am calculating item based cosine similarity

(1,5).(1,5)/|(1,5)||(1,5)|=1 (m1 and m2 are exactly similar)

when i am calculating user based cosine similarity

(1,1).(5,5)/|(1,1)||(5,5)|=1 (u1 and u2 are exactly similar)

But u1 and u2 are not similar as u1 did not like any movie but u2 like both the movie. Please help.. let me know where i am wrong

Ryan Walker
  • 3,176
  • 1
  • 23
  • 29
Asmit
  • 1
  • 2
  • I think you have too little data to be able to calculate a 'correct' similarity. Try expanding your dataset and compare them to other online correlation calculators –  Nov 29 '16 at 15:48

1 Answers1

0

The Cosine Similarity measures the angle between two vectors. You both vectors point to exactly the same direction. Thus, they are similar (or rather equal for this measure). You need another comparison which also consider the vector length.

clemens
  • 16,716
  • 11
  • 50
  • 65