K Nearest neighbor (k-nearest NEIGHBOR,KNN) Classification algorithm
1, definition: If a sample in the feature space in the k nearest (that is, the closest feature space) of the sample most belong to a category, then the sample belongs to this category.
2, calculation formula:;
3, K-Nearest neighbor algorithm needs to do standardized processing;
4. K-Nearest Neighbor algorithm API
5. Advantages:
1) simple, no parameter handling, no training required
6. Disadvantages:
1) lazy algorithm, when the test sample classification of large computational capacity, memory overhead;
2) must be specified k value, K value is not properly selected classification accuracy is not guaranteed;
7, the use of the scene: small data volume, thousands of ~ Tens of thousands of samples.
8, speed up the search speed-based on improved algorithm kdtree.
3. K-Nearest Neighbor algorithm