我正在使用sklearn并微调SVM,但当我尝试执行
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内核。我做错了什么吗?