title: DBSCAN Clustering Python - cluster words
body: <p>I have been using KMeans in order to extract clusters from a set of lines and i'm not very impressed with the results and i wanted to try out DBSCAN to see if this can produce better results. Does DBSCAN output cluster words as KMeans ?</p>
  
  <p>I was able to use DBSCAN and was able to output number of clusters as '3' but <strong>i would like to know what context is driving it to make '3' clusters (i would like to know the words)</strong></p>
  
  <p>here is my code snippet </p>
  
  <pre><code> db = DBSCAN(eps=0.3, min_samples=10).fit(X)
   core_samples_mask = np.zeros_like(db.labels_, dtype=bool)
   core_samples_mask[db.core_sample_indices_] = True
   labels = db.labels_
  
   # Number of clusters in labels, ignoring noise if present.
   n_clusters_ = len(set(labels)) - (1 if -1 in labels else 0)
  
   print('Estimated number of clusters: %d' % n_clusters_)
  
   print("Silhouette Coefficient: %0.3f"% metrics.silhouette_score(X, labels))
  </code></pre>