Let us say I want to find a similar vector for a vector a = [0 0 2 0 0 0 0 0 0]
I have two candidates:
- b1 = [0 0 0 2 0 0 0 0 0], where the "feature" is just 1 position away
- b2 = [0 0 0 0 0 0 0 2 0], where the "feature" is 5 positions away
Euclidean distance for (a, b1) is the same as for (a, b2). What I want is for b1 to get a higher "similarity" score. Is there a well-known method (name it, please) to deal with such problems? Some kind of fuzzy Euclidean distance?
One possible solution I can come up with is to calculate the Euclidean distance for (a, b1) with the whole b1 shifted by 1 position left, then by 2 positions left, by 3 positions left, etc., then do the same for shifting right. Every time I do it, I adjust the calculated Euclidean position by a weight which decreases as the shifting distance increases. The same procedure is then repeated for b2. Then the results are compared to find a better match.