2
$\begingroup$

Suppose I have 4 vectors, the first 2 vectors are of length 4 and the last 2 vectors are of length 400. all values in the vectors range from 0.5 to 0.6.

The Euclidean distance between the last 2 vectors will be greater than the distance between the first 2 vectors. This is due to the much larger dimensionality of the last 2 vectors.

How can I modify my approach to make both the distance values comparable ? I have thought of using Cosine or Jaccard distance, but I do not want the similarity/angle between the vectors.

Could I simply divide each distance by the length of the vectors ?

So the new distance d1 would be:

d1 = d1/4

and the new distance d2 would be:

d2 = d2/400

Would this approach be an effective way to compute the Euclidean distance between data where the scale of each value is the not skewed, but the length of the pair of vectors between which the distance is measured is not uniform ?

$\endgroup$
1
  • $\begingroup$ Because the distances mean different things in different dimensions, could you explain what you mean by "comparable"? This is a little like asking to make inches and kilograms comparable. Could you tell us your purpose in trying to compare those distances? $\endgroup$
    – whuber
    Commented Aug 16, 2023 at 17:31

1 Answer 1

9
$\begingroup$

If you want to calculate the Euclidean distance of normalized vectors, use cosine similarity instead. They are proportional to each other and roughly equivalent.

$\endgroup$
1
  • $\begingroup$ I am also concerned with the difference in magnitude of the vectors and not the orientation/angle between the vectors. Could the Euclidean distance scaled by the reciprocal of the dimension of the vector or scaled by the reciprocal of the squared dimension of the vector be an effective way to compare the magnitudes between the 2 distance measures ? $\endgroup$ Commented Aug 16, 2023 at 16:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.