From be4459861ce0d3e5008f9725d1dbc5bda2ed68cd Mon Sep 17 00:00:00 2001 From: LiYufeng <2371258046@qq.com> Date: Wed, 16 Oct 2024 22:12:31 +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 | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/function.py b/function.py index ecdc7b9..8e319ed 100644 --- a/function.py +++ b/function.py @@ -116,20 +116,4 @@ test_data, test_labels = load_dataset('C:\\Users\\Administrator\\Desktop\\testDi for i in range(len(test_data)): predicted_label = knn_classify(test_data[i], train_data, train_labels, k=3) true_label = test_labels[i] - print(f"预测标签: {predicted_label}, 真实标签: {true_label}") - - - - - - - "00000000000001111111110000000000" - "00000000000000000111100000000000" - ) - predicted_label = classify( - np.array([int(char) for char in test_data]).reshape(1, 1024), - train_data, - train_labels, - ) - - print(f"预测的标签: {predicted_label}") + print(f"预测标签: {predicted_label}, 真实标签: {true_label}") \ No newline at end of file