What is considered to be a good silhouette score?

  k-means, python

I am currently doing some clustering based on words embeddings, and I am using some methods (elbow and David-Boulding) to determine the optimal number of clusters I should consider. In addition, I consider the silhouette measure. If I understood it correctly, it is a measure of the correct match of the data with the correct cluster, ranging from – 1 (mismatch) to 1 (correct match).

Using kmeans clustering, I obtain a silhouette score oscillating between 0.5 and 0.55. So according to the silhouette, the elbow method (that is a bit too smooth but it might because I have a lot of data) and the David-Bouldin index, I should consider 5 clusters. However, I don’t know if 0.5 can be considered as a good score? I added the graphs of the different measures I made, the function I used to generate them (found online) as well as the clustering obtained.

def check_clustering(X, K):
    sse,db,slc = {}, {}, {}
    for k in range(2, K):
        # seed of 10 for reproducibility.
        kmeans = KMeans(n_clusters=k, max_iter=1000,random_state=SEED).fit(X)
        if k == 3: labels = kmeans.labels_
        clusters = kmeans.labels_
        sse[k] = kmeans.inertia_ # Inertia: Sum of distances of samples to their closest cluster center
        db[k] = davies_bouldin_score(X,clusters)
        slc[k] = silhouette_score(X,clusters)


    plt.figure(figsize=(15,10))
    plt.plot(list(sse.keys()), list(sse.values()))
    plt.xlabel("Number of cluster")
    plt.ylabel("SSE")
    plt.show()

    plt.figure(figsize=(15,10))
    plt.plot(list(db.keys()), list(db.values()))
    plt.xlabel("Number of cluster")
    plt.ylabel("Davies-Bouldin values")
    plt.show()

    plt.figure(figsize=(15,10))
    plt.plot(list(slc.keys()), list(slc.values()))
    plt.xlabel("Number of cluster")
    plt.ylabel("Silhouette score")
    plt.show()

enter image description here
enter image description here
enter image description here

enter image description here

I am quite new to k-means clustering and mainly followed online tutorials. Can somebody tell me if the scores obtained through the different measures (but mostly silhouette’s) seem correct?

Thank you for your answer.

(Also, there is a subsidiary question but I find the shape of the clusters a bit weird (I would expect them to be more fragmented). Is it a possible shape of clusters? (Note that I used the PCA to reduce the dimensions, so it might be because of that).
Thank you for your help.

Source: Python Questions

LEAVE A COMMENT