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

This commit is contained in:
77
2024-12-27 14:54:46 +08:00
parent 3b65cc400a
commit f84c4a0a2b
+1 -2
View File
@@ -1,8 +1,6 @@
id = "202210423201"
name = "陈瑞琪祥"
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
@@ -76,3 +74,4 @@ if __name__ == "__main__":
test_sample = X_test[11] # 选择第12个样本(从0开始计数)
y_pred_single = predict_svm(test_sample.reshape(1, -1), weights, bias)
print(f"\n单个样本预测结果: {y_pred_single[0]}, 实际结果: {y_test[11]}")