Open Iamshg opened 3 years ago
Are there random things,such as seed?
The DBSCAN algorithm is deterministic, always generating the same clusters when given the same data in the same order. However, the results can differ when data is provided in a different order. First, even though the core samples will always be assigned to the same clusters, the labels of those clusters will depend on the order in which those samples are encountered in the data. Second and more importantly, the clusters to which non-core samples are assigned can differ depending on the data order. This would happen when a non-core sample has a distance lower than eps to two core samples in different clusters. By the triangular inequality, those two core samples must be more distant than eps from each other, or they would be in the same cluster. The non-core sample is assigned to whichever cluster is generated first in a pass through the data, and so the results will depend on the data ordering.
It seems that the cluster result of dbscan-on-spark is not right. I used sklearn to generate 100 data, and used sklearn to train data. The result is different from that of dbscan-on-spark . Here are my experimental data and results. Is there something wrong with me or the dbscan-on-spark code. The 100 data is , first and second column is x and y , the third is the output clusterid used dbscan-on-spark with parameter
maxPointsPerPartition=12, eps = 0.3 , minPoints = 10
.plot the dbscan-on-spark result.
plot the sklearn dbscan result
so , there are some difference between two image . Is there something wrong with me or the code?