更新 function.py
Gitea Actions Experiment Test / Experiment-Actions (push) Successful in 20s

This commit is contained in:
2024-10-16 22:12:31 +08:00
parent b1c2b25e06
commit be4459861c
+1 -17
View File
@@ -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}")