我在Weka的整个训练集上使用k-fold交叉验证进行超参数调整,它显示了交叉验证的平均精度,召回率,f1。我希望在python中使用Sklearn获得相同的结果。
cv = StratifiedShuffleSplit(n_splits=5, test_size=0.2, random_state=42)
grid = GridSearchCV(LinearSVC(), param_grid=param_grid, cv=cv)
grid.fit(X_train, y_train)
# print the best parameters
print("The best parameters are %s with a score of %0.5f"
% (grid.best_params_, grid.best_score_))
# print the average precision, recall, f1, accuracy of cross
# validation with the best parameters found
???
任何人都可以提供帮助吗?