计算机工程 ›› 2012, Vol. 38 ›› Issue (20): 160-163.doi: 10.3969/j.issn.1000-3428.2012.20.041

• 人工智能及识别技术 • 上一篇    下一篇

改进型加权KNN算法的不平衡数据集分类

王超学1,潘正茂1,马春森2,董丽丽1,张 涛1   

  1. (1. 西安建筑科技大学信息与控制工程学院,西安 710055;2. 中国农业科学院植物保护研究所,北京 100193)
  • 收稿日期:2011-12-16 修回日期:2012-02-20 出版日期:2012-10-20 发布日期:2012-10-17
  • 作者简介:王超学(1967-),男,副教授,主研方向:智能计算;潘正茂(通讯作者),硕士研究生;马春森,研究员;董丽丽,教授;张 涛,硕士研究生
  • 基金项目:
    国家自然科学基金资助项目(31170393);陕西省自然科学基金资助项目(2012JM8023);陕西省教育厅自然科学专项基金资助项目(12JK0726)

Classification for Imbalanced Dataset of Improved Weighted KNN Algorithm

WANG Chao-xue1, PAN Zheng-mao1, MA Chun-sen2, DONG Li-li1, ZHANG Tao1   

  1. (1. School of Information and Control Engineering, Xi’an University of Architecture and Technology, Xi’an 710055, China; 2. Institute of Plant Protection, Chinese Academy of Agricultural Sciences, Beijing 100193, China)
  • Received:2011-12-16 Revised:2012-02-20 Online:2012-10-20 Published:2012-10-17

摘要: K最邻近(KNN)算法对不平衡数据集进行分类时分类判决总会倾向于多数类。为此,提出一种加权KNN算法GAK-KNN。定义新的权重分配模型,综合考虑类间分布不平衡及类内分布不均匀的不良影响,采用基于遗传算法的K-means算法对训练样本集进行聚类,按照权重分配模型计算各训练样本的权重,通过改进的KNN算法对测试样本进行分类。基于UCI数据集的大量实验结果表明,GAK-KNN算法的识别率和整体性能都优于传统KNN算法及其他改进算法。

关键词: 不平衡数据集, 分类, K最邻近算法, 权重分配模型, 遗传算法, K-means算法

Abstract: Based on analyzing the shortages of K-Nearest Neighbor(KNN) algorithm in solving classification problems on imbalanced dataset, a novel KNN approach based on weight strategy(GAK-KNN) is presented. The key of GAK-KNN lies on defining a new weight assignment model, which can fully take into account the adverse effects caused by the uneven distribution of training sample between classes and within classes. The specific steps are as follows: use K-means algorithm based on Genetic Algorithm(GA) to cluster the training sample set, compute the weight for each training sample in accordance to the clustering results and weight assignment model, use the improved KNN algorithm to classify the test samples. GAK-KNN algorithm can significantly improve the identification rate of the minority samples and overall classification performance. Theoretical analysis and comprehensive experimental results on the UCI dataset con?rm the claims.

Key words: imbalanced dataset, classification, K-Nearest Neighbor(KNN) algorithm, weight assignment model, Genetic Algorithm(GA), K-means algorithm

中图分类号: