gb_gs.fit(X_train, y_train) # 拟合模型 gb_gs = gb_gs.best_estimator_ # 最佳模型 y_pred = gb_gs.predict(X_test) # 进行预测 print("梯度提升测试准确率: {:.2f}%".format(gb_gs.score(X_test, y_test)*100)) print("梯度提升测试F1分数: {:.2f}%".format(f1_score(y_test, y_pred)*100))