generated from LufsX/Challenge-SVM
This commit is contained in:
+2
-1
@@ -72,4 +72,5 @@ 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]}")
|
||||
print(f"\n单个样本预测结果: {y_pred_single[0]}, 实际结果: {y_test[11]}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user