고차원의 Feature를 비교할 때 measure로 두 방법을 많이 사용합니다.
dot product와 cosine similiarity는 둘 다 semantic relation을 계산할 때 많이 사용되는 measure입니다
두개의 차이점을 간단하게 알아보겠습니다
Think geometrically. Cosine similarity only cares about angle difference, while dot product cares about angle and magnitude. If you normalize your data to have the same magnitude, the two are indistinguishable. Sometimes it is desirable to ignore the magnitude, hence cosine similarity is nice, but if magnitude plays a role, dot product would be better as a similarity measure. Note that neither of them is a "distance metric".
한국어 material이 별로 없어서 영어 원문을 간단하게 정리하겠습니다.
- 비교할 두 feature를 normalization을 한 후에는, 두 measure는 같은 의미를 갖는다
- feature(vector)의 크기가 의미가 없을 때는, cosine similarity를 사용하는 것이 낫다
- feature(vector)의 크기까지 고려해야 할 때는, dot product를 사용하는것이 더 낫다
feature(vector)크기와 각도까지 고려 : dot product
feature(vector)끼리의 각도만 고려 : cosine similarity
원문