voting = voting.fit(X_train, y_train) # 拟合模型 y_pred = voting.predict(X_test) # 进行预测 print("Voting测试准确率: {:.2f}%", voting.score(X_test, y_test)*100) print("Voting测试F1分数:{:.2f}%", f1_score(y_test, y_pred)*100)