Cluster vectors according to the k-means algorithm. Initially, one input vector is arbitrarily assigned to each cluster. The distance between all vectors and these cluster vectors is then calculated. Each vector is then assigned to its closest cluster and the centroid of each cluster is calculated. Then the algorithm is repeated by recalcualteng distances to centroids and resaaigning vectors to clusters. Once the centroids stop moving, the algorithm is finished.