Skip to content

Instantly share code, notes, and snippets.

@ashunigion
Last active January 26, 2019 06:06
Show Gist options
  • Save ashunigion/393a192d314ba19913db3b7213f13175 to your computer and use it in GitHub Desktop.
Save ashunigion/393a192d314ba19913db3b7213f13175 to your computer and use it in GitHub Desktop.
from sklearn.cluster import KMeans
kmeans_0 = KMeans(n_clusters=10, init='k-means++',random_state=0).fit(label_0)
sample_0 = kmeans_0.cluster_centers_
kmeans_1 = KMeans(n_clusters=10, init='k-means++',random_state=0).fit(label_1)
sample_1 = kmeans_1.cluster_centers_
#the code can be repeated for all the intermediate labels
#...
kmeans_9 = KMeans(n_clusters=10, init='k-means++',random_state=0).fit(label_9)
sample_9 = kmeans_9.cluster_centers_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment