From 6a9f90ec2c131aac1d12415d12c36708103f72ae Mon Sep 17 00:00:00 2001 From: dong <2938690875@qq.com> Date: Wed, 16 Oct 2024 18:35:29 +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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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): """ 从文件夹中加载数据,若不自行正确实现,则无法通过评测,**不记录成绩**。