Traditional Culture Encyclopedia - Traditional virtues - What is knn algorithm?

What is knn algorithm?

KNN(K nearest neighbor) method, namely K nearest neighbor method, was first proposed by Cover and Hart in 1968. It is a mature method in theory and one of the simplest machine learning algorithms.

As a nonparametric classification algorithm, KNN algorithm is very effective and easy to implement. It has been widely used in classification, regression and pattern recognition.

introduce

KNN algorithm itself is simple and effective, and it is a lazy learning algorithm. The classifier does not need to use training set for training, and the training time complexity is 0. The computational complexity of KNN classification is proportional to the number of documents in the training set, that is, if the total number of documents in the training set is n, then the classification time complexity of KNN is O(n).

Although KNN method also depends on limit theorem in principle, it is only related to a few adjacent samples when making class decisions. Because KNN method mainly depends on the limited adjacent samples around, rather than the method of classifying domains, KNN method is more suitable for dividing sample sets with more overlapping or overlapping domains than other methods.