The code is very nice and well documented. In some cases, however, the clusters are not properly identified if no initial centroid vectors are provided. This could be improved by automatically trying a small number of different random initial guesses and chosing the configuration which yields the smallest sum of distance between points and centroids.