generated from LufsX/Challenge-SVM
This commit is contained in:
+1
-2
@@ -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]}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user