From fe4094754db6c44141aef8addf69088fa81650bd Mon Sep 17 00:00:00 2001 From: heart20003 <1789588961@qq.com> Date: Thu, 17 Oct 2024 00:58:12 +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 b941de4..f4700d1 100644 --- a/function.py +++ b/function.py @@ -39,7 +39,7 @@ name = "陈垣豪" - int: 预测的分类标签。 """ -def classify0(inX, dataSet, labels, k=1): +def classify0(inX, dataSet, labels, k=3): # 计算协方差矩阵并求其逆矩阵 cov_matrix = np.cov(dataSet, rowvar=False) inv_cov_matrix = np.linalg.inv(cov_matrix)