Skip to main content
. Author manuscript; available in PMC: 2024 Jan 11.
Published in final edited form as: Artif Intell Med. 2023 Feb 28;139:102523. doi: 10.1016/j.artmed.2023.102523

Table 2. Techniques for measuring the similarity between two vectors u and v of size d.

Similarity between the two vectors has an inverse relationship with metric value in a “decreasing” relationship, such as Euclidean distance.

Similarity Technique Description Relation Formula
Euclidean distance Length of the line between ends of vectors Decreasing u1v12+u2v22++udvd2
Cosine similarity Cosine of the angle between vectors (θ) Increasing uTvu.v
Dot product Cosine θ multiplied by lengths of the vectors Increasing u1v1+u2v2++udvd=uv cos(θ)