I'm implementing the k-means algorithm (in R Map-Reduce) and I wanted to verify if the output I'm getting is close enough to the true centroids of the cluster. This is how I'm verifying with a 2D dataset currently: I plot both the dataset and the centroids I've got as output and see if the centroids are close to the centre of the clusters visually. I think I can do that for 3D data too. But I don't know how to verify this with higher dimensional data that cannot be plotted.
It looks really stupid to plot the data and visually verify each time, right? So let me tell you why I'm doing this:
The centroids don't come in a particular order. The 1st centroid in this trial might be in the 2nd position in the next, so I can't find the distance between the matrix of my output and the matrix of, say, the R's default kmeans output (if I'm verifying my output with R's kmeans). Sorting with respect to any one dimension to compare sounds stupid, since any dimension can be a lot more sensitive to the data when compared to another.
So, for now, I'm verifying 2D data visually. Do I have to use dimensionality reduction? Does someone have ideas about how I can verify higher dimension data?