Machine Learning Basics
Which of the following describes the procedure of clustering with k-means (k-means clustering)?
- AStart with all data in one cluster and split off the data farthest from the rest one by one, dividing until there are k clusters
- BPlace k tentative centers, assign each data point to the cluster of the nearest center and make each cluster's mean the new center, repeating until the assignments stop changing
- CFor each point to be clustered, find the k nearest points in the training data and decide its cluster by a majority vote of their labels
Show answer and explanation
Answer: B. Place k tentative centers, assign each data point to the cluster of the nearest center and make each cluster's mean the new center, repeating until the assignments stop changing
k-means fixes the number of clusters k in advance and works as follows: (1) choose k centers, (2) assign each data point to the cluster of the nearest center, (3) make the mean of each cluster's data its new center, and repeat (2) and (3) until the assignments stop changing. The result depends on the initial centers and can stop at a solution that is not the best partition, so the algorithm is run several times with different initial values, or an initialization such as k-means++ is used. The value of k is not determined automatically, so it is chosen with guides such as the elbow method.
- A. This is closer to divisive hierarchical clustering, which splits the whole set step by step; it is not the k-means procedure.
- B. Correct. Assignment and center updates are repeated until the assignments stop changing.
- C. This is the idea of k-nearest neighbors (k-NN). k-NN is a supervised classification method that uses correct-answer labels.