为什么两个向量不相似但结果为1? [英] why two vectors is not similarity but result is 1?
问题描述
我正在使用余弦相似度公式计算两个向量之间的相似度.我尝试了两个不同的向量,如下所示:
I'm using Cosine Similarity formula to caculate similarity between two vectors. I tried two different vectors like this:
Vector1(-1237373741,27,1,1,331289590,1818540802)
Vector2(-1237373741,49,1,1,331289590,1818540802)
两个向量略有不同,但结果为 1 .
Two vectors has a little different, but the result is 1.
我不知道为什么?有人可以为我解释这个问题吗?非常感谢.
I don't know why? Anyone can explain this problem for me? thanks so much.
推荐答案
在大多数情况下,这两个向量指向同一方向(较大的坐标将主导另一个坐标的较小差异).余弦相似度约为1(请记住cos(0)= 1)
For the most part, those two vectors are are pointing in the same direction (The larger coordinates are going to dominate the smaller differences in the other coordinate). A cosine similarity of ~1 is expected (Remember that cos(0) = 1)
这篇关于为什么两个向量不相似但结果为1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!