diff --git a/function.py b/function.py index 974ce3c..8de62e1 100644 --- a/function.py +++ b/function.py @@ -41,8 +41,8 @@ name = "董秋" # 这里写自己的代码实现 -from collections import Counter -def classify(input_vector, dataSet, labels, k=0): + +def classify(input_vector, dataSet, labels, k=3): """ KNN 分类算法。 @@ -66,7 +66,7 @@ def classify(input_vector, dataSet, labels, k=0): # 这里也写自己的代码实现 -from PIL import Image + def load_dataset(directory): """ 从文件夹中加载数据,若不自行正确实现,则无法通过评测,**不记录成绩**。