KNN文本分类算法是一种简单、有效、非参数的分类方法。针对传统的KNN文本分类算法的不足,出现了很多改进的KNN算法。但改进的KNN分类算法大多数是建立在样本选择的基础上。即以损失分类精度换取分类速度。针对传统的KNN文本分类算法的不足,提出一种基于特征加权的KNN文本分类算法(KNNFW),该算法考虑各维特征对模式分类贡献的不同,给不同的特征赋予不同的权值,提高重要特征的作用,从而提高了算法的分类精度。最后给出实验结果并对实验数据进行分析得出结论。
KNN classification algorithm is a simple and effective method of classification.According to the deficiencies of traditional KNN,there appear a lot of improved KNN algorithms,but most improved KNN classification algorithm is based on the sample selection,namely,loss of classification accuracy for classification rate.According to the deficiencies of traditonal KNN algorithm,a KNN algorithm basd on feature weighting(KNNFW)is proposed in this paper.the a-lgorithm considers different contributions of the fractal features to the pattern classification,gives different weight to different characteristics,improves the important role of the features,so as to improve the accuracy of classification algorithm.The experimental results are presented and the experimental data analysis conclusion is also achieved.