def gs_SVC(xM, yVc, params, n_folds=5):
"""
Since classification is considered, we use yVc which includes digital values
whereas yV can include float point values.
"""
print(xM.shape, yVc.shape)
clf = svm.SVC()
#parmas = {'alpha': np.logspace(1, -1, 9)}
kf5_c = model_selection.KFold(n_splits=n_folds, shuffle=True)
kf5 = kf5_c.split(xM)
gs = model_selection.GridSearchCV(clf, params, cv=kf5, n_jobs=-1)
gs.fit(xM, yVc)
return gs
评论列表
文章目录