Can someone give an example of cosine similarity, in a very simple, graphical way?

前端 未结 10 1890
别跟我提以往
别跟我提以往 2020-11-28 17:04

Cosine Similarity article on Wikipedia

Can you show the vectors here (in a list or something) and then do the math, and let us see how it works?

I\'m a begin

10条回答
  •  余生分开走
    2020-11-28 17:36

    For simplicity I am reducing the vector a and b:

    Let :
        a : [1, 1, 0]
        b : [1, 0, 1]
    

    Then cosine similarity (Theta):

     (Theta) = (1*1 + 1*0 + 0*1)/sqrt((1^2 + 1^2))* sqrt((1^2 + 1^2)) = 1/2 = 0.5
    

    then inverse of cos 0.5 is 60 degrees.

提交回复
热议问题