Understanding and find the best eps value for DBSCAN
KMeans and DBSCAN are two different types of Clustering techniques.
The elbow method you used to get the best cluster count should be used in K-Means only.
You used that value i.e. K=4 to assign colors to the scatterplot, while the parameter is not used in DBSCAN fit method.
Actually that is not a valid parm for DBSCAN
You will have to control &quot;esp&quot; to control the number of Clusters
Fit with esp=6 resulted in 112 Clusters. You only need these few lines of code
dbscan2 = DBSCAN(eps=6, min_samples=10).fit(data3)
fig = plt.figure(figsize=(12,7))

# max(dbscan2.labels_) # This is the number of Cluster
plt.scatter(data3[:,0], data3[:,1], s=10, edgecolors='none', c=dbscan2.labels_, alpha=0.5, cmap='hsv')