我正在使用 sklearn 并正在微调我的 SVM,但是当我尝试做 a 时GridSearchCV
,我得到了我什至没有网格搜索的参数!
举个例子:
parameters = {'kernel':['linear'], 'C': [10, 100, 1000]}
cv = cross_validation.ShuffleSplit(len(X), n_iter=4, test_size=0.1, random_state=None)
svr = SVC()
clf = grid_search.GridSearchCV(svr, parameters, cv=cv)
clf.fit(X,Y) #X,Y are my two datasets
当我运行时clf.get_params()
,我得到:
n_jobs : 1
verbose : 0
estimator__gamma : auto
estimator__decision_function_shape : None
estimator__probability : False
param_grid : {'kernel': ['linear'], 'C': [10, 100, 1000]}
cv : ShuffleSplit(120, n_iter=4, test_size=0.1, random_state=None)
scoring : None
estimator__cache_size : 200
estimator__verbose : False
pre_dispatch : 2*n_jobs
estimator__kernel : rbf
fit_params : {}
estimator__max_iter : -1
refit : True
iid : True
estimator__shrinking : True
estimator__degree : 3
estimator__class_weight : None
estimator__C : 1.0
estimator__random_state : None
estimator : SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,
decision_function_shape=None, degree=3, gamma='auto', kernel='rbf',
max_iter=-1, probability=False, random_state=None, shrinking=True,
tol=0.001, verbose=False)
estimator__coef0 : 0.0
error_score : raise
estimator__tol : 0.001
它每次都给我一个 C 值 1 和 rbf 内核。有什么我做错了吗?