Handwriting Recognition using K-Means - Code from hints leads to different results

Hey there,

my name is Daniel. I am right now working on the above mentioned project. But I end up with my cluster centers having indexes that differ from those in the solution:

Is anyone else experience this?
I am totally new to this field so I might be missing something, but anyone has an explanation?
Thanks in andvance!

In the end I used the exact same code as seen in the hints:

import codecademylib3_seaborn
import numpy as np
from matplotlib import pyplot as plt
from sklearn import datasets
from sklearn.cluster import KMeans

digits = datasets.load_digits()

#leaving out the initial visualisation part

##7
model = KMeans(n_clusters=10, random_state=42)

model.fit(digits.data)

##9
fig = plt.figure(figsize=(8, 3))

fig.suptitle(‘Cluser Center Images’, fontsize=14, fontweight=‘bold’)

##10
for i in range(10):

#Initialize subplots in a grid of 2X5, at i+1th position
ax = fig.add_subplot(2, 5, 1 + i)

#Display images
ax.imshow(model.cluster_centers_[i].reshape((8, 8)), cmap=plt.cm.binary)

plt.show()

I got the same number order as you with random_state=42 (I used a different one before). I might be wrong, I guess they have used different parameter before, maybe random_state, and changed it after some rewriting or modification on the project. They probably forgot to check and modify this part at same time, it happens on other subject or preject as well.
I think it’s ok to have different numbers, just change the numbers on step.17 to your number order.