Sklearn Kmeans Mnist

pca = PCA(n_components=n_digits)
X_pca = pca.fit(inputs).transform(inputs)

kmeans = KMeans(n_clusters=n_digits, init=pca.components_, n_init=1)
predict = kmeans.fit(inputs).predict(inputs)

stats = clusters_stats(predict, Y)
purity = clusters_purity(stats)

print("Plotting an extract of the 10 clusters, overall purity: %f" % purity)

#plot_clusters(predict, Y, stats)
print(pca.components_)
Terrible Tortoise