Description: K-nearest neighbors 搜索 聚类时经常使用的一种方法 国外网站转载- The following utilities are provided:
- Nearest neighbor
- K-Nearest neighbors
- Radius Search
They al supports N-dimensions and work on double, it is possible to choose if return the distances.
Here is a time comparison with a vectrized m-code:
N=1000000 number of reference points
Nq=100 number of query points
dim=3 dimension of points
k=3 number of neighbor
tic
[idc,dist]=BruteSearchMex(p ,qp , k ,k) MEX
toc
tic
[idc,dist]=knnsearch(qp,p,k) VECTORIZED M-CODE
toc
p=rand(N,dim)
qp=rand(Nq,dim)
Output:
Elapsed time is 0.962640 seconds.
Elapsed time is 18.813100 seconds. Platform: |
Size: 4096 |
Author:Ming |
Hits:
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. Platform: |
Size: 3072 |
Author:刘晓红 |
Hits:
Description: KNN classifiers,
training is training set, testing is test set,
D is the distance, D=1 is mandistance D=2 is 欧氏距离 D=3是 infinite norm
K is the number of selected neighbors- KNN classifiers,
training is training set, testing is test set,
D is the distance, D=1 is mandistance D=2 is 欧氏距离 D=3是 infinite norm
K is the number of selected neighbors Platform: |
Size: 2048 |
Author:二 |
Hits:
Description: 利用matlab实现就近点邻域寻找算法,获取指定点k邻域范围内的点集-Using matlab realize the neighborhood looking for the nearest point algorithms, access points within a specified point range k neighborhood Platform: |
Size: 1024 |
Author:户田 |
Hits: