How I can convert distance (Euclidean) to similarity score I am using $k$ means clustering to cluster speaker voices. When I compare an utterance with clustered speaker data I get (Euclidean distance-based) average distortion. This distance can be in range of $[0,\infty]$. I want to convert this distance to a $[0,1]$ similarity score. Please guide me on how I can achieve this. 
 A: If $d(p_1,p_2)$ represents the euclidean distance from point $p_1$ to point $p_2$,
$$\frac{1}{1 + d(p_1, p_2)}$$
is commonly used.
A: You could also use: $\frac{1}{e^{dist}}$ where dist is your desired distance function.
A: It sounds like you want something akin to cosine similarity, which is itself a similarity score in the unit interval. In fact, a direct relationship between Euclidean distance and cosine similarity exists!
Observe that
$$
||x-x^\prime||^2=(x-x^\prime)^T(x-x^\prime)=||x||+||x^\prime||-2||x-x^\prime||.
$$
While cosine similarity is 
$$
f(x,x^\prime)=\frac{x^T x^\prime}{||x||||x^\prime||}=\cos(\theta)
$$ where $\theta$ is the angle between $x$ and $x^\prime$.
When $||x||=||x^\prime||=1,$ we have 
$$
||x-x^\prime||^2=2(1-f(x,x^\prime))
$$
and
$$
f(x,x^\prime)=x^T x^\prime,
$$
so
$$
1-\frac{||x-x^\prime||^2}{2}=f(x,x^\prime)=\cos(\theta)
$$ in this special case.
From a computational perspective, it may be more efficient to just compute the cosine, rather than Euclidean distance and then perform the transformation.
A: How about a Gaussian kernel ? 
$K(x, x') = \exp\left( -\frac{\| x - x' \|^2}{2\sigma^2} \right)$
The distance $\|x - x'\|$ is used in the exponent. The kernel value is in the range $[0, 1]$. There is one tuning parameter $\sigma$. Basically if $\sigma$ is high, $K(x, x')$ will be close to 1 for any $x, x'$. If $\sigma$ is low, a slight distance from $x$ to $x'$ will lead to $K(x,x')$ being close to 0.
A: If you are using a distance metric that is naturally between 0 and 1, like Hellinger distance. Then you can use 1 - distance to obtain similarity.
