Cosine Distance is a metric used to determine the similarity between two non-zero vectors in an 内積 space. It is defined as one minus the cosine of the angle between the vectors. This measure is particularly useful in various fields like テキスト分析, レコメンデーションシステム, and 機械学習, where the orientation of the data points is more significant than their magnitude.
数学的には、コサイン距離は次のように表されます:
Cosine Distance(A, B) = 1 – (A • B) / (||A|| ||B||)
ここで:
- A • B is the ドット積 ベクトルAとBの。
- ||A|| and ||B|| は、それぞれベクトルAとBの大きさ(または長さ)です。
コサイン距離の値は0から2の範囲です。コサイン距離が0の場合、2つのベクトルは方向が完全に一致していることを示し、値が1の場合、ベクトルは直交(全く異なる)していることを示します。
Cosine distance is particularly effective for high-dimensional data, such as text represented as word vectors in 自然言語処理. In such cases, it helps in identifying how similar two documents are based on the context of the words used, rather than their frequency, making it a robust measure for various AI applications.