I got this definitional difference between distortion and inertia from here:
Two values are of importance here — distortion and inertia. Distortion is the average of the euclidean squared distance from the centroid of the respective clusters. Inertia is the sum of squared distances of samples to their closest cluster centre
However, when I searched for an example from here:
distortions.append(sum(np.min(cdist(X, kmeanModel.cluster_centers_,
'euclidean'), axis=1)) / X.shape[0])
I took one inertia value from:
and 1 distortion value from :
however the values 217.64 and 3.45 aren't simply a division of 217.64 by count of variables in x (17).
Can anyone detail on what exactly is the formula for distortion?