I know that KNN is a supervised learning method and K-means is an unsupervised clustering method. I also know their algorithms.

What I am confused about is that what is the point having K-means given that we can KNN? It is often stated that we can use K-means to cluster users so that we can make a decision for a certain user based on the behavior of other users within the same group. However, isn't it the exact same thing that KNN does---assuming the same outcome based on other similar characteristics.

So what is the difference in the application between the two? Thanks

  • $\begingroup$ You can only use $k$-NN when you have labels, i.e. pre-existing clusters $\endgroup$
    – Henry
    Feb 3, 2020 at 17:25

1 Answer 1


k-NN is a supervised algorithm used for classification. In supervised learning, we already have labelled data on which we train our model on training data and then use it on the unseen data i.e. test data. In this case of classification, the labelled data is discrete in nature.

k-Means, on the other hand, is an unsupervised algorithm used for clustering. In unsupervised learning, we don't have any labelled data to train our model. Hence the algorithm just relies on the dynamics of the independent features to make inferences on unseen data.

I hope this helps.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.