K-means is a simplified version of the Expectation-Maximization (EM) algorithm.

  • E-step (Expectation): This is the assignment step. For fixed prototypes, each data point is assigned to the nearest cluster. This is equivalent to calculating which cluster is “expected” for each point.
  • M-step (Maximization): This is the update step. With the cluster assignments fixed, the prototypes are moved to the mean of their assigned data points. This new position maximizes the similarity to the assigned points (i.e., minimizes the error J for the given assignments).