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

This commit is contained in:
2024-10-20 11:30:43 +08:00
parent 38362c4391
commit 0ea7c660da
+1 -2
View File
@@ -30,7 +30,6 @@ def classify(input_vector, dataSet, labels, k=3):
# 返回投票最多的标签
return max(label_count, key=label_count.get)
def load_data(directory):
"""
加载手写数字数据集.
@@ -55,7 +54,6 @@ def load_data(directory):
return dataset, np.array(labels)
def img_to_vector(filename):
"""
将32x32的二值图像转换为1x1024向量.
@@ -120,3 +118,4 @@ if __name__ == "__main__":
train_data, train_labels)
print(f"预测的标签: {predicted_label}")