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]