# Effect of value of k in K-Nearest Neighbor

In K-Nearest Neighbor the value of k decides the accuracy of classification. What are the pros and cons of choosing smaller value for k and larger value for k?

• This issue is certainly mentioned in the relevant literature, have you checked there? – Yuval Filmus Nov 21 '15 at 21:28

There is no simple answer. The standard approach to choose $k$ is to try different values of $k$ and see which provides the best accuracy on your particular data set (using cross-validation or hold-out sets, i.e., a training-validation-test set split).
Intuitively, $k$-nearest neighbors tries to approximate a locally smooth function; larger values of $k$ provide more "smoothing", which or might not be desirable.