I am using DBSCAN from sklearn in python to cluster some data points. I am using a precomputed distance matrix to cluster the points.
import sklearn.cluster as cl
C = cl.DBSCAN(eps = 2, metric = 'precomputed', min_samples =2)
db = C.fit(Dist_Matrix)
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
[ 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]
in another run, it is like
[ 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]
How can I resolve this? Please help
min_samples=2is too small. You are doing single-link, not DBSCAN! - Has QUIT--Anony-Mousse