generated from LufsX/Experiment-kNN
This commit is contained in:
@@ -112,6 +112,7 @@ if __name__ == "__main__":
|
|||||||
)
|
)
|
||||||
# 将测试数据转换为向量
|
# 将测试数据转换为向量
|
||||||
test_vector = np.array([int(char) for char in test_data]).reshape(1, 1024)
|
test_vector = np.array([int(char) for char in test_data]).reshape(1, 1024)
|
||||||
|
|
||||||
# 进行分类预测
|
# 进行分类预测
|
||||||
predicted_label = classify(test_vector, train_data, train_labels)
|
predicted_label = classify(test_vector, train_data, train_labels)
|
||||||
print(f"预测的标签: {predicted_label}")
|
print(f"预测的标签: {predicted_label}")
|
||||||
|
|||||||
Reference in New Issue
Block a user