k-means
k-means is a clustering algorithm that assigns each point to the nearest of k centroids, then repeatedly recalculates those centroids until assignments stop changing.
Prerequisite: Clustering
What matters
The number of clusters, k, must be chosen in advance, and the algorithm's result depends on this choice, which is why picking the right k is often the hardest part of using it.
Example
Running k-means with k set to 4 on customer data forces the algorithm to organize all customers into exactly four groups, whether or not that number truly fits the data.
Common misconception
k-means does not discover the 'correct' number of clusters on its own; you must specify k beforehand, and choosing it poorly can produce unnatural groupings.
Recall question
What must be decided before running k-means that the algorithm cannot determine itself?