Difference between KNN and K-means

Question

How is KNN different from k-means clustering

in progress 0
Pragya Rani 4 years 1 Answer 1323 views Contributor 0

Answer ( 1 )

  1. Don’t get mislead by ‘k’ in their names. You should know that the fundamental difference between both these algorithms is, k-means is unsupervised in nature and kNN is supervised in nature. K-means is a clustering algorithm. kNN is a classification (or regression) algorithm.
    k-means algorithm partitions a data set into clusters such that a cluster formed is homogeneous and the points in each cluster are close to each other. The algorithm tries to maintain enough separability between these clusters. Due to unsupervised nature, the clusters have no labels.
    kNN algorithm tries to classify an unlabeled observation based on its k (can be any number ) surrounding neighbors. It is also known as a lazy learner because it involves minimal training of the model. Hence, it doesn’t use training data to make generalization on an unseen data set.

Leave an answer

Browse
Browse