There's more…

The vector quantization algorithm can be used to divide a dataset into a number of clusters. The algorithm is based on the calculation of the Euclidean distance for the allocation of the samples to the cluster, to which it belongs. The algorithm consists of the following steps:

  1. At the beginning, all the vectors are assigned to the same cluster, whose centroid is calculated as the mean value of all the vectors.
  2. For each centroid, a perturbation is introduced that generates two new cluster centers. The old representative is discarded.
  3. Each carrier is reassigned to one of the new clusters according to the minimum distance criterion.
  4. The new representatives are calculated as the average value of the vectors assigned to each cluster. These will be the new centers of the cluster.
  5. If the end criterion is met, the algorithm terminates. If not, return to step 2.