APP下载

基于局部密度和相似度的自适应SNN算法

2021-03-22刘娜生龙

电脑知识与技术 2021年6期

刘娜 生龙

摘要:在近邻算法中,近邻样本和目标样本之间的绝对距离和相似性为目标样本类别的判断提供重要的决策依据,K值的大小也会直接决定了近邻算法的预测效果。然而,SNN算法在预测过程中,使用固定的经验K值来预测不同局部密度的目标样本,具有一定的片面性。因此,为实现SNN算法中K值的合理调节,提高算法的预测准确度和稳定性,提出一种基于局部密度和相似度的自适应SNN算法(AK-SNN)。算法的性能在UCI数据集上进行验证,结果显示该算法取得优于KNN和SNN的预测效果和鲁棒性。

关键词:KNN;SNN;相似度计算;局部密度;自适应;AK-SNN

中图分类号: TP301        文献标识码:A

文章编号:1009-3044(2021)06-0006-04

Abstract:In the nearest-neighbor algorithm, the absolute distance and similarity between the nearest-neighbor samples and the object sample provide significant decision basis for judging class of the object sample, and the size of K directly determines the prediction effect of the nearest-neighbor algorithm. However, in prediction process of SNN algorithm, it uses empirical K value selection to predict target samples with different local densities, which has some one-sidedness. Therefore, an adaptive SNN algorithm (AK-SNN) based on local density and similarity is proposed to realize reasonable adjustment of K in the SNN algorithm and improve the prediction accuracy and stability of the algorithm. The performance of the algorithm is verified on the UCI dataset, and the results show that the proposed algorithm achieves better prediction effect and robustness than KNN and SNN.

Key words:KNN; SNN; similarity calculation; local density; AK-SNN

引言

近邻算法具有容易实现、训练时间短等特点,是一种高效实用的分类算法。KNN(K-Nearest Neighbor) [1]作为近邻算法中最为常用的分类算法,被广泛应用于手写体识别[2],数据挖掘与金融等方面。但算法中依然存在一些问题:1)距离度量方式的问题;2)最近邻样本集的选择存在偏好问题[3];3)K值大小对于算法性能影响问题。

为解决KNN存在的问题,周青等将特征熵融入KNN中,提出了一种FECD-KNN分类算法,该算法将特征熵作为类相关度,以其差异值计算样本距离,从而建立距离测度与类别间的内在联系[4]。黄光华等提出了一种基于交叉验证和距离加权的改进KNN算法[5],减小算法的空间复杂度,改善预测性能。张兵等人提出了基于局部密度和纯度的自适应选取K值的方法,提高算法准确率[6]。茹强喜和刘永利用主分量分析(PCA)与粗糙集理论(RS)对高维样本集降维,并使用模拟退火算法实现随机属性子集选择,最终利用多重K近邻分类器进行组合实现样本类别预测,有效地改进了K近邻法的分类精度和效率[7]。……

登录APP查看全文