Description: 用得最多的是最近邻,此处上传的是K-近邻,即k=1。matlab环境下的代码。附有实例。-used most often is the nearest neighbor, here is uploaded K-neighbor, k = 1. Matlab environment code. With examples. Platform: |
Size: 1024 |
Author:宋争鸣 |
Hits:
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: K近邻算法在Matlab中的实现,相当完整,对研究KNN算法有一定帮助-K nearest neighbor in the Matlab, implementation, rather complete, the study of KNN algorithm has certainly helped Platform: |
Size: 134144 |
Author:long |
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-K近邻法实现两分类的函数代码,输入为两类的样本特征,和待测试的样本向量,输出为分类结果。-knn-K nearest neighbor method to achieve the two categories of function code, enter the characteristics of two types of samples, and samples to be tested vector, the output for the classification. Platform: |
Size: 1024 |
Author:kevin |
Hits:
Description: 这是哈尔滨工业大学,电子与信息工程学院,模式识别课程,上机实验3,主要内容是使用matlab产生二维实验和测试样本,并采用最近邻和K近邻分类的方法对测试样本进行分类。完全自主敲写的代码,并运行通过-This is the Harbin Institute of Technology, School of electronic and information engineering, pattern recognition course, Experiment 3, the main content is to generate two-dimensional experiment and test samples using MATLAB method, and the nearest neighbor and K nearest neighbor classifier to classify the test sample. Completely independent knockout write code, and run through!!!
Platform: |
Size: 32768 |
Author:朱安国 |
Hits: