title: Varying cluster labels in DBSCAN
body: <p>I am using DBSCAN from sklearn in python to cluster some data points. I am using a precomputed distance matrix to cluster the points.</p>
  
  <pre><code>import sklearn.cluster as cl
  C = cl.DBSCAN(eps = 2, metric = 'precomputed', min_samples =2)
  db =  C.fit(Dist_Matrix)
  </code></pre>
  
  <p>Dist_Matrix is precomputed distance matrix I am using. Each time when I run my code, I am getting different cluster labels for the data points. Number of clusters is also varying
  Like, in the first run,labels are </p>
  
  <pre><code>[ 2  3  3  0  3  0  2  2  2  4  2 -1  0  0  0  1  4  0  1  0  1  3  0  3  0
  0  1 -1  0  3  1  3  0  0  2  0  2  0 -1  0  0  3  0  0  0  1  0  1  0  0]
  </code></pre>
  
  <p>in another run, it is like</p>
  
  <pre><code>[ 0  2  2  1  2  1  0  0  0  3  0 -1  1  1  1  0  3  1  0  1  0  2  1  2  1
  1  0 -1  1  2  0  2  1  1  0  1  0  1 -1  1  1  2  1  1  1  0  1  0  1  1]
  </code></pre>
  
  <p>How can I resolve this? Please help</p>