基于加权K—最近邻分类的手写数字识别
2018-10-21俞玉莲
摘要:机器学习算法是人工智能应用领域的热点研究问题。将改进加权距离的K-最近邻分类算法应用到手写数字智能识别中,通過计算机仿真实验验证了该算法预测准确率为85%。为了减少算法计算量,Kd-Tree等高效的检索技术是今后的研究方向。
关键词:K-最近邻;智能识别;加权距离
the Handwritten Digit Recognition Based on Weighted K-Nearest Neighbor Algorithm
YU Yu-lian
(College of Communication Engineering,Shanghai Technical Institute of Electronics&Information,Shanghai 201411,China)
Abstract:Machine learning algorithms are hot research problems in the field of artificial intelligence applications. The improved weighted distance to K - nearest neighbor classification algorithm is applied to intelligent handwritten numerals recognition,the algorithm is verified through the code experiment forecast accuracy of 85%. In order to reduce the algorithm computation,the efficient retrieval technology such as Kd-Tree is the research direction in the future.
Key words:K-Nearest Neighbor;intelligent identification;the weighted distance
1 引言
近年来随着人工智能应用的发展,机器学习算法成了热点研究问题[1]。在众多机器学习算法中[2],K-最近邻(K-Nearest Neighbor,KNN)算法是理论上比较成熟的分类算法[3-4],有较高的分类准确率。该文首先阐述了KNN算法原理,提出了改进的加权距离,用以降低算法对K的选择的敏感度;其次通过计算机仿真实验论证了KNN算法在手写数字智能识别中的应用;最后展望了KNN算法改进的研究方向。
2 K-最近邻(KNN)算法原理
2.1 KNN算法概念
K-最近邻(KNN)算法是一种典型的非参模型,与生成方法(generalizing method)不同的是,在KNN算法中,通过以实例的形式存储所有的训练样本。对于一个待预测的样本,通过计算它与训练样本之间的差异性,并将差异按照由小到大排序,选出前面K个差异最小的类别,并统计在K个中类别出现次数最多的类别为最相似的类,最终将待预测样本分到最相似的训练样本的类中。
2.2 样本差异性算法
常用的差异性计算方法为欧式距离、曼哈顿距离等。该文实验中使用欧式距离:假设测
试样本,训练样本,两者之间的欧式距离为D,D
值越小,两者相似度越大。
2.3 KNN算法流程
(1)计算测试数据与各个训练数据之间的距离;
(2)按照距离的递增关系进行排序;……
