GridSearchCV参考代码
CC = []
gammas = []
for i in range(-5, 16, 2):
CC.append(2 ** i)
for i in range(3, -16, -2):
gammas.append(2 ** i)
param_grid = {"C": CC, "gamma": gammas}
gs = GridSearchCV(SVC(probability=True), param_grid, cv=10)
gs.fit(x, y)
print(gs.best_estimator_)
print(gs.best_score_)
如何打印中间调参过程
from pprint import pprint
pprint(gs.cv_results_)
RandomizedSearchCV