Im trying to make my algorithm, which involves KMeans, reproducible, but even If I set random_state value I always get different inertia values. I'm using this page dataset without the first line (dataset size).
Steps/Code to Reproduce
from sklearn.cluster import KMeans
import numpy as np
points = np.genfromtxt('page.txt')
for l in range(10):
kmeans = KMeans(n_clusters=30, n_init=1, random_state=42)
kmeans.fit(points)
centroids = kmeans.cluster_centers_
print('{0:.20f}'.format(kmeans.inertia_))
Expected Results
I expect to get printed ten time the same value
Actual Results
1008436173.14048004150390625000
1008436173.14048004150390625000
1008436173.14047992229461669922
1008436173.14048004150390625000
1008436173.14047992229461669922
1008436173.14048004150390625000
1008436173.14047992229461669922
1008436173.14048004150390625000
1008436173.14048004150390625000
1008436173.14048004150390625000