K-Means - Why the optimal number of cluster is varying with Silhouette Analysis?

Viewed 184
1 Answers

KMeans algorithm starts to set randomly clusters centers before performing Gradient Descent.

Due to the stochastic nature of the algorithm, your data may be not well suited to use this.

Try to perform your analysis with setting random state to 0, at each iteration like:

km = KMeans(n_clusters=k, random_state=0)

Is this leading to the same optimum ?

Related