/  Top Machine learning interview questions and answers   /  Why we need to take only odd values of K in KNN algorithm?
KNN-classifier-1-i2tutorials

Why we need to take only odd values of K in KNN algorithm?

As we decrease the value of K to 1, our predictions become less stable. Inversely, as we increase the value of K, our predictions become more stable due to majority averaging, and thus, more likely to make more accurate predictions. Eventually, we begin to witness an increasing number of errors. In cases where we are taking a majority vote among labels, we usually make K an odd number to have a tiebreaker.

Leave a comment