From 07d82589f69402dffb8b6944a1856e3c55723056 Mon Sep 17 00:00:00 2001 From: LufsX Date: Wed, 25 Sep 2024 19:29:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20function.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/function.py b/function.py index 787bfd7..d230bdf 100644 --- a/function.py +++ b/function.py @@ -68,7 +68,7 @@ def classify0(inX, dataSet, labels): # 统计前 k 个样本的标签 classCount = {} - for i in range(3): + for i in range(9): voteLabel = labels[sortedDistIndices[i]] classCount[voteLabel] = classCount.get(voteLabel, 0) + 1