KNN方法存在两个不足:a)计算量巨大,它要求计算未知文本与所有训练样本间的相似度进而得到k个最近邻样本;b)当类别间有较多共性,即训练样本间有较多特征交叉现象时,KNN分类的精度将下降。针对这两个问题,提出了一种改进的KNN方法,该方法先通过Rocchio分类快速得到k0个最有可能的候选类别;然后在k0个类别训练文档中抽取部分代表样本采用KNN算法;最后由一种改进的相似度计算方法决定最终的文本所属类别。实验表明,改进的KNN方法在Web文本分类中能够获得较好的分类效果。
KNN method not only has large computational demands, because it must compute the similarity between unlabeled text and all training texts ; but also may decrease the precision of classification because of the commonness of classes. This paper presented an improved KNN method, which solved two problems mentioned above. It firstly got the most k0 classes fast by Rocchio method, and then used KNN arithmetic in some representative training texts of the classes, at last assigned class by an improved similar arithmetic in KNN. The result of research indicates that the impact of the new method is better.