-
The first question is the choice of K-value?
-
How to quickly find a K-neighbor, especially if the feature space dimension is large and the training data capacity is large.
(1) K-value problem: When the K value is very small, it is equivalent to a small field of training examples to predict, the approximate error of learning will be reduced, only the training instance closer to the input instance will work on the predicted results (in turn, the closer you are, the more similar, the farther away, the similarity is very poor). But the disadvantage is that the estimation error of learning will increase, the prediction results will be very sensitive to the neighbor's instance point, if the neighbor's instance point happens to be noise, the prediction will be wrong. (Noisy, more complex), the more complex the model, the more prone to the occurrence of fit
If the selection is large, it is equivalent to using the training examples in the larger field to predict. The advantage is that it can reduce the estimated error of learning
The larger the K, the more training instance that is farther from the input instance (which can reduce noise) means that the overall model changes Be simple
In general, the K value is obtained through the intersection verification method. Generally takes k value less than sqrt (n)
(2) How to quickly search for K neighbors?
KD trees are a good way to
This article from "Jane Answers Life" blog, declined reprint!
Common problems in K-nearest neighbor algorithm