sklearn使用小记GridSearchCV
def test_grid_search():
from sklearn import datasets,svm
iris = datasets.load_iris()
parameters = {'kernel': ('linear', 'rbf'), 'C': [1, 10,50,100]} #注意score='roc_auc'是二分类的,多分类会报错
svc = svm.SVC()
clf = GridSearchCV(svc, parameters,cv=7)
clf.fit(iris.data, iris.target)
print(type(clf.best_params_))
print(clf.best_params_)