The k-nearest neighbors algorithm is a supervised learning method used for classification and regression.
For each point \(x_i\) of a test data set \(X_{test}\), this algorithm computes the \(k\) points of a given training set \(X_{train}\)
which are the most similar to \(x_i\).