1
$\begingroup$

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?

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

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.

| cite | improve this answer | |
$\endgroup$
0
$\begingroup$

It's something about parameter tuning. You should change the K-value from lower values to high values and keep track of all accuracy value. But as whole if you choose the lower values in kNN your model will learn to predict more locally while if you choose the large values for kNN your model will learn to predict more globally.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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