The k-nearest neighbors algorithm (k-NN) is a non-parametric supervised learning method used for classification and regression. It works by selecting the k closest training examples in a dataset as input. The output depends on whether k-NN is used for classification or regression:
The k-NN algorithm is sensitive to the local structure of the data.
Back to all