Concept

"n_neighbors" Parameter for KNN Classifier

The n_neighbors parameter specifies the number of neighbors to consider when classifying points. This number is sometimes referred to as "K". A high n_neighbors risks overfitting the test data and being poor at predicting new data (high bias). On the other hand, a low n_neighbors risks underfitting the data, hence oversimplifying the model and resulting in a "jumpy" plot of predictions (high variance). The best value for K will depend on the dataset, so one value for K may work well for some datasets, but not for others.

0

2

Updated 2020-10-17

Tags

Data Science