Which distance do we measure in the case of KNN?

The hamming distance is measured in case of KNN for the determination of nearest neighbours. Kmeans uses euclidean distance.

 

In the case of k-Nearest Neighbors (KNN), the distance typically measured is the Euclidean distance. Euclidean distance is a measure of the straight-line distance between two points in a Euclidean space. However, depending on the specific use case and requirements, other distance metrics such as Manhattan distance, Minkowski distance, or cosine similarity may also be used in KNN. It’s essential to choose the appropriate distance metric based on the nature of the data and the problem at hand.