I am writing code for DBSCAN clustering. I find the eps value which is 0.12 with the help of the Elbow/Knee method. But in the plot, the cluster number is going to the out of the X-axis. It about 177 clusters and only 13 clusters fitted within the figure box. But the other 164 clusters generated the outer side of the X-axis. So how may I fix this problem?

My code:

import seaborn as sns
dbscan = DBSCAN(eps=distances[knee.knee], min_samples=10).fit(Y)
labels = dbscan.labels_

#fig = plt.figure(figsize=(5, 5))
#fig = plt.figure(figsize=(36,12))

sns.scatterplot(Y[:,0], Y[:,1], hue= ["cluster-{}".format(x) for x in labels])

plt.title("DBSCAN Clustering Method")
plt.xlabel('Number of clusters', fontsize = 10) 
plt.ylabel('Silhouette Score', fontsize = 10) 
plt.title('DBSCAN Cluster with Silhouette Score Method ')


DBSCAN Cluster

  • $\begingroup$ @dan-scally Dear mentor please help me to fix this problem. $\endgroup$
    – As if
    Commented Jun 7, 2020 at 0:42
  • $\begingroup$ @65767 Dear mentor please help me to fix this problem $\endgroup$
    – As if
    Commented Jun 7, 2020 at 0:42


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.