title: How to obtain the documents that belongs to its cluster in density based clustering?
body: <p>I use DBSCAN clustering for text document as follows,
  thanks to <a href="https://stackoverflow.com/questions/25217065/scikit-learn-clustering-text-documents-using-dbscan">this post</a>.</p>
  
  <pre><code>db = DBSCAN(eps=0.3, min_samples=2).fit(X)
  core_samples_mask1 = np.zeros_like(db1.labels_, dtype=bool)
  core_samples_mask1[db1.core_sample_indices_] = True
  labels1 = db1.labels_
  
  </code></pre>
  
  <p>Now I want to see which document belongs to which cluster, like:</p>
  
  <pre><code>[I have a car and it is blue] belongs to cluster0
  </code></pre>
  
  <p>or</p>
  
  <pre><code>idx [112] belongs to cluster0
  </code></pre>
  
  <p>The similar way my question asked in <a href="https://stackoverflow.com/questions/50823999/obtain-the-clustered-documents-of-dbscan">here</a> but I am already tested the some of the answers provided there as:</p>
  
  <pre><code>X[labels == 1,:]
  </code></pre>
  
  <p>and I got :</p>
  
  <pre><code>array([[0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0],
         [0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0]], dtype=int64)
  </code></pre>
  
  <p>but this does not help me. Please let me know if you have any suggestion or ways to do it.</p>