After a k-means clustering computation the following results are stored:
cluster centres - the centre of the clusters.
labels - the cluster each sample in the data matrix belongs to.
inertia - the sum of the squared distances of each sample to its closest cluster centre.
iterations - the number of iterations that were performed.
Two post-processing operations may be of interest:
transform - given a data matrix \(X\) in the same coordinates as the original data matrix \(A\), express \(X\) in terms of new coordinates in which each dimension is the distance to the cluster centres previously computed for \(A\).
predict - given a data matrix \(Y\) find the closest cluster centre out of the clusters previously computed for \(A\).