Is there a general way to convert between a measure of similarity and a measure of distance?
Consider a similarity measure like the number of 2-grams that two strings ha
Yes, there is a most general way to change between similarity and distance: a strictly monotone decreasing function f(x)
.
That is, with f(x)
you can make similarity = f(distance)
or distance = f(similarity)
. It works in both directions. Such function works, because the relation between similarity and distance is that one decreases when the other increases.
Examples:
These are some well-known strictly monotone decreasing candidates that work for non-negative similarities or distances:
f(x) = 1 / (a + x)
f(x) = exp(- x^a
)f(x) = arccot(ax)
You can choose parameter a>0
(e.g., a=1
)