基于K近邻的分类算法研究
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
.专业整理.
航空航天大学
Shenyang Aerospace University
算法分析
题目:基于K-近邻分类算法的研究
院系计算机学院
专业计算机技术
姓名
学号
指导教师
2015年 1 月
摘要
数据挖掘是机器学习领域广泛研究的知识领域,是将人工智能技术和数据库技术紧密结合,让计算机帮助人们从庞大的数据中智能地、自动地提取出有价值的知识模式,以满足人们不同应用的需要。K 近邻算法(KNN)是基于统计的分类方法,是数据挖掘分类算法中比较常用的一种方法。该算法具有直观、无需先验统计知识、无师学习等特点,目前已经成为数据挖掘技术的理论和应用研究方法之一。
本文主要研究了 K 近邻分类算法。首先简要地介绍了数据挖掘中的各种分类算法,详细地阐述了 K 近邻算法的基本原理和应用领域,其次指出了 K 近邻算法的计算速度慢、分类准确度不高的原因,提出了两种新的改进方法。
针对 K 近邻算法的计算量大的缺陷,构建了聚类算法与 K 近邻算法相结合的一种方法。将聚类中的K -均值和分类中的 K 近邻算法有机结合。有效地提高了分类算法的速度。
针对分类准确度的问题,提出了一种新的距离权重设定方法。传统的 KNN 算法一般采用欧式距离公式度量两样本间的距离。由于在实际样本数据集合中每一个属性对样本的贡献作用是不尽相同的,通常采用加权欧式距离公式。本文提出一种新的计算权重的方法。实验表明,本文提出的算法有效地提高了分类准确度。最后,在总结全文的基础上,指出了有待进一步研究的方向。
关键词:K 近邻,聚类算法,权重,复杂度,准确度
ABSTRACT
Data mining is a widely field of machine learning, and it integrates the artificial intelligence technology and database technology. It helps people extract valuable knowledge from a large data intelligently and automatically to meet different people applications. KNN is a used method
in data mining based on Statistic. The algorithm has become one of the ways
in data mining theory and application because of intuitive, without priori statistical knowledge, and no study features.
The main works of this thesis is k nearest neighbor classification algorithm. First, it introduces mainly classification algorithms of data mining and descripts theoretical base and application. This paper points out the reasons of slow and low accuracy and proposes two improved ways.
In order to overcome the disadvantages of traditional KNN, this paper use two algorithms of classification and clustering to propose an improved KNN classification algorithm. Experiments show that this algorithm can speed up when it has a few effects in accuracy.
According to the problem of classification accuracy, the paper proposes a new calculation of weight. KNN the traditional method generally used Continental distance formula measure the distance between the two samples. As the actual sample data collection in every attribute of a sample of the contribution is not the same, often using the weighted Continental distance formula. This paper presents a calculation of weight,that is weighted based on the characteristics of KNN algorithm. According to this Experiments on artificial datasets show that this algorithm can improve the accuracy of classification.
Last, the paper indicates the direction of research in future based on the full-text.
Keywords: K Nearest Neighbor, Clustering Algorithm, Feature Weighted, Complex Degree, Classification Accuracy.
前言
K最近邻(k-Nearest neighbor,KNN)分类算法,是一个理论上比较成熟的方法,也是最简单的机器学习算法之一。该方法的思路是:如果一个样本在特征空间中的k个最相似(即特征空间中最邻近)的样本中的大多数属于某一个类别,则该样本也属于这个类别。KNN算法中,所选择的邻居都是已经正确分类的对象。该方法在定类决策上只依据最邻近的一个或者几个样本的类别来决定待分样本所属的类别。 KNN方法虽然从原理上也依赖于极限定理,但在类别决策时,只与极少量的相邻样本有关。由于KNN方法主要靠周围有限的邻近的样本,而不是靠判别类域的方法来确定所属类别的,因此对于类域的交叉或重叠较多的待分样本集来说,KNN方法较其他方法更为适合。
KNN算法不仅可以用于分类,还可以用于回归。通过找出一个样本的k个最近邻居,将这些邻居的属性的平均值赋给该样本,就可以得到该样本的属性。更有用的方法是将不同距离的邻居对该样本产生的影响给予不同的权值(weight),如权值与距离成正比。该算法在分类时有个主要的不足是,当样本不平衡时,如一个类的样本容量很大,而其他类样本容量很小时,有可能导致当输入一个新样本时,该样本的K个邻居中大容量类的样本占多数。该算法只计算“最近的”邻居样本,某一类的样本数量很大,那么或者这类样本并不接近目标样本,或者这类样本很靠近目标样本。无论怎样,数量并不能影响运行结果。可以采用权值的方法(和该样本距离小的邻居权值大)来改进。
该方法的另一个不足之处是计算量较大,因为对每一个待分类的文本都要计算它到全体已知样本的距离,才能求得它的K个最近邻点。目前常用的解决方法是事先对已知样本点进行剪辑,事先去除对分类作用不大的样本。该算法比较适用于样本容量比较大的类域的自动分类,而那些样本容量较小的类域采用这种算法比较容易产生误分