From 7e3f7317228223cbdc14d9e0bada684fd84711d7 Mon Sep 17 00:00:00 2001 From: wujunjie <297081150@qq.com> Date: Sun, 6 Oct 2024 18:18:15 +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 a31aea5..1908924 100644 --- a/function.py +++ b/function.py @@ -68,7 +68,7 @@ def classify0(inX, dataSet, labels): classCount[voteLabel]=classCount.get(voteLabel,0)+1 # 返回出现次数最多的标签 sortedClasscount=sorted( - classCount.items(), key=operator, itemgetter(1), reverse = True + classCount.items(), key=operator.itemgetter(1), reverse = True ) return sortedclassCount[0][0]