How is KNN different from k-Means?
Jun 6, 2021
- Both algorithms coincidentally have the same k letter, but they are very different.
- KNN — K nearest neighbor — supervised algorithm (classification/regression), k-Means — unsupervised algorithm (clustering)
- Both use distance measurements but KNN needs labeled data whereas k-Means requires no data only a threshold on how many clusters we want to group the data into
- In KNN, each unlabeled data point is marked with the majority label of the k nearest data points. In k-Means, data points are grouped to into their nearest centroids.