title: How to convert Euclidean distances between vectors to similarity scores
body: <p>Below is my code for calculating Euclidean distance between vectors, and a snippet of my transformed data set (vectors).</p>
  
  <pre><code>import itertools
  import numpy as np
  
  vect=[[2, 1, 1, 1, 1, 3, 4, 2, 5, 1],
   [1, 5, 2, 1, 1, 1, 1, 1, 1, 2],
   [2, 1, 1, 1, 2, 1, 1, 1, 1, 1]]
  
  for u1, u2 in itertools.combinations(vect, 2):
      x = np.array(u1)
      y = np.array(u2)
      space = np.linalg.norm(y - x)
      print space
  </code></pre>
  
  <p>The Euclidean distances between the vectors are:</p>
  
  <pre><code>7.0
  5.56776436283
  4.472135955
  </code></pre>
  
  <p>My goal is to compute the similarity between the vectors and output a similarity score for each comparison. Typical similarity score lies between 0 and 1, with 0-being not similar and 1-exactly similar. The question here is how can I convert the Euclidean distances to similarity scores? 
  Someone suggested this formula: 1/1+d(P1, P2) ie inverse of Euclidean distance=similarity score.Any suggestions? thanks</p>