The KNN classification algorithm is a mature theory and
one of the simplest machine learning algorithms (Wu,
Ianakiev, & Govindaraju, 2002). The theory of this method is
that if a sample in the feature space is similar to k samples
with the majority of the k samples belonging to a certain
category, then this sample also belongs to that category. In the
KNN algorithm, the selection of the k value has a significant
influence on the accuracy of the model. It can be determined
through an m-times cross-validation to the training set which
determines the most accurate k value.