Euclidean Distance
A metric measuring the straight-line distance between two points in vector space. It is one of the basic methods of vector similarity computation and, alongside cosine similarity and dot product, is a commonly used distance metric in vector databases.
Timeline (last 90 days)
There are three main ways to measure vector distance: cosine similarity, Euclidean distance (L2), and inner product (IP).
Euclidean distance measures the straight-line distance between two vectors in space, is very sensitive to the magnitude of the vectors, and takes both direction and size into account.
Cosine similarity and Euclidean distance may give diametrically opposite judgments about which two vectors are more similar.
For vectors A=(1,1) and B=(2,2), the cosine similarity is 1 and the Euclidean distance is approximately 1.41; the cosine similarity between A and C=(1,0) is approximately 0.707 and the Euclidean distance is 1.
Euclidean distance is more appropriate in scenarios where magnitude carries important information, such as spatial clustering (e.g., K-Means), image feature matching, and anomaly detection.
The K-Means clustering algorithm inherently relies on Euclidean distance in its standard implementation, computing the Euclidean distance from each sample point to the cluster center at every step to assign categories.
All Facts (6)
There are three main ways to measure vector distance: cosine similarity, Euclidean distance (L2), and inner product (IP).
50%UnverifiedEuclidean distance measures the straight-line distance between two vectors in space, is very sensitive to the magnitude of the vectors, and takes both direction and size into account.
50%UnverifiedCosine similarity and Euclidean distance may give diametrically opposite judgments about which two vectors are more similar.
50%UnverifiedFor vectors A=(1,1) and B=(2,2), the cosine similarity is 1 and the Euclidean distance is approximately 1.41; the cosine similarity between A and C=(1,0) is approximately 0.707 and the Euclidean distance is 1.
50%UnverifiedEuclidean distance is more appropriate in scenarios where magnitude carries important information, such as spatial clustering (e.g., K-Means), image feature matching, and anomaly detection.
50%UnverifiedThe K-Means clustering algorithm inherently relies on Euclidean distance in its standard implementation, computing the Euclidean distance from each sample point to the cluster center at every step to assign categories.
50%