



A distance metric that measures the number of positions at which corresponding elements in two vectors differ. Particularly useful for binary vectors and categorical data, commonly used with binary quantization in vector search.
The Hamming distance is a metric that compares two numeric vectors and computes how many changes are needed to convert one vector to the other. It counts the number of dimensions that differ between two vectors.
For two vectors of equal length, the Hamming distance is the number of positions at which the corresponding elements are different.
Vector A: [1, 0, 1, 1, 0] Vector B: [1, 1, 1, 0, 0] Hamming Distance: 2 (positions 2 and 4 differ)
Unlike Euclidean or cosine distance, Hamming distance works on discrete values and is particularly efficient for binary data where each comparison is a single CPU instruction.
Not applicable (mathematical concept).
Loading more......