Efficient K-Nearest Neighbor Search using JIT
by Yi Cao
27 Mar 2008
(Updated 22 Apr 2010)
A small but efficient tool to perform KNN search
|
Watch this File
|
| File Information |
| Description |
This is a small but efficient tool to perform K-nearest neighbor search, which has wide Science and Engineering applications, such as pattern recognition, data mining and signal processing.
The code was initially implemented through vectorization. After discussions with John D'Errico, I realized that my algorithm will suffer numerical accurancy problem for data with large values. Then, after trying several approaches, I found simple loops with JIT acceleration is the most efficient solution. Now, the performance of the code is comparable with kd-tree even the latter is coded in a mex file.
The code is very simple, hence is also suitable for beginner to learn knn search. |
| Acknowledgements |
The author wishes to acknowledge the following in the creation of this submission:
distance.m, KD Tree Nearest Neighbor and Range Search, NEARESTPOINT, nearestneighbour.m
This submission has inspired the following:
Compute surface variation
|
| MATLAB release |
MATLAB 7.5 (R2007b)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 07 Jul 2008 |
fix a bug |
| 22 Apr 2010 |
a bug fixed |
|
Contact us at files@mathworks.com