from sklearn.svm import SVC # 导入SVM模型 svm = SVC(random_state = 1) svm.fit(X_train, y_train) y_pred = svm.predict(X_test) # 预测心脏病结果 svm_acc = svm.score(X_test, y_test)*100