1 accuracy: 100.0000000000% 2 accuracy: 100.0000000000% 3 accuracy: 98.1927710843% 4 accuracy: 98.1927710843% 5 accuracy: 91.2650602410% 6 accuracy: 92.4698795181% 7 accuracy: 87.0481927711% 8 accuracy: 88.8554216867% 9 accuracy: 86.1445783133% 10 accuracy: 88.8554216867% 11 accuracy: 87.9518072289% 12 accuracy: 89.1566265060% 13 accuracy: 87.3493975904% 14 accuracy: 88.5542168675% 15 accuracy: 86.1445783133% 16 accuracy: 87.9518072289% 17 accuracy: 84.3373493976% 18 accuracy: 84.6385542169% 19 accuracy: 82.2289156627% 20 accuracy: 84.6385542169%中的k值和准确率哪个更好
时间: 2023-08-23 07:05:32 浏览: 336
解决keras,val_categorical_accuracy:,0.0000e+00问题
在这个数据集中,k值为2和3时准确率都达到了100%,因此这两个k值的效果都非常好。但是,k值过小容易导致过拟合,而k值过大则容易导致欠拟合。因此,需要根据具体的应用场景和数据集特征来选择合适的k值。如果需要更高的准确率并且数据集较大,则可以选择k值较小的2或3;如果需要更稳定的结果,则可以选择k值较大的12或13。所以,需要根据实际情况进行权衡和选择。
阅读全文