How is KNN different from k-means clustering? - letsdiskuss
Official Letsdiskuss Logo
Official Letsdiskuss Logo


Earn With Us

James D

Blogger | Posted on | others

How is KNN different from k-means clustering?


tech blogger | Posted on

People usually get confused with K-means and KNN. In fact these both are completely different methods. Though they both have the letter k does not mean both are similar. Below mentioned explanation on both methods helps us in understanding the difference between.
K nearest neighbors is an abbreviation for KNN which is a simple classification algorithm. KNN is specialized in storing all cases and based on similarity measures it classifies new cases. It is also popularly known as the lazy learning algorithm and non-parametric where the actual purpose of KNN is to use a database where the data points are separated into numerous classes. This entire process is done to predict the new sample’s classification. Here KNN is supervised as we try to classify a point based on the known classification of other points.
Whereas K-means clustering is a method of vector quantization and is a simple unsupervised machine learning clustering algorithm. It is basically used when you have unlabeled data and is popular in data mining for cluster analysis. K-means clustering is in fact used as a feature learning step and is very easy to implement and apply on large datasets. K-means is unsupervised as the points have no external classification.

ref links: 
image courtesy: 


Picture of the author