I use DBSCAN clustering for text document as follows, thanks to this post.
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_
Now I want to see which document belongs to which cluster, like:
[I have a car and it is blue] belongs to cluster0
or
idx [112] belongs to cluster0
The similar way my question asked in here but I am already tested the some of the answers provided there as:
X[labels == 1,:]
and I got :
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)
but this does not help me. Please let me know if you have any suggestion or ways to do it.