OneVsRestClasssifer
으로 GridSearchCV
을 실행 중입니다. SVC
을 견적 도구로 사용하고 있습니다. , INT :GridSearchCV는 rbf 커널과 다른 차수의 SVC를 컴퓨팅합니까?
http://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html
정도 :하여
degree
매개 변수가poly
커널에 의해서만 사용되는 SVC의 문서에 따르면pipeline = Pipeline([ ('clf', OneVsRestClassifier(SVC(verbose=True), n_jobs=1)), ]) parameters = { "clf__estimator__C": [0.1, 1], "clf__estimator__kernel": ['poly', 'rbf'], "clf__estimator__degree": [2, 3], } grid_search_tune = GridSearchCV(pipeline, parameters, cv=2, n_jobs=8, verbose=10) grid_search_tune.fit(train_x, train_y)
: 이것은 내
Pipeline
및GridSearchCV
매개 변수의 측면이다 선택 사항 (기본값 = 3)다항식 커널의 차수 기능 ('폴리'). 다른 모든 커널에서는 무시됩니다.
하지만 난 내 GridSearchCV
의 출력을 볼 때 그것이 degree
매개 변수에 대한 rbf
커널과 다른 값으로 각 SVC
구성에 대한 다른 실행을 계산하는 것 같다.
[CV] clf__estimator__kernel=poly, clf__estimator__C=0.1, clf__estimator__degree=2
[CV] clf__estimator__kernel=poly, clf__estimator__C=0.1, clf__estimator__degree=2
[CV] clf__estimator__kernel=rbf, clf__estimator__C=0.1, clf__estimator__degree=2
[CV] clf__estimator__kernel=rbf, clf__estimator__C=0.1, clf__estimator__degree=2
[CV] clf__estimator__kernel=poly, clf__estimator__C=0.1, clf__estimator__degree=3
[CV] clf__estimator__kernel=poly, clf__estimator__C=0.1, clf__estimator__degree=3
[CV] clf__estimator__kernel=rbf, clf__estimator__C=0.1, clf__estimator__degree=3
[CV] clf__estimator__kernel=rbf, clf__estimator__C=0.1, clf__estimator__degree=3
커널이
rbf
로 설정되어있는 경우
이 정도의 모든 값이 무시하지 않나요?
답장을 보내 주셔서 감사합니다. 점수를 확인해야하지만 SVC (커널 = 'rbf')가 계산되고있는 것으로 판단됩니다. 사실이라면 낭비입니다. 모든 점수가 같아야하기 때문입니다. GridSearchCV는이 점수를 무시할 정도로 "똑똑"해야합니다. 나는 sklearn 메일 링리스트에 대해 쓸 것입니다. –
@DavidBatista 예. 서로 다른 각도 값에 대해 같은 실행이 계산됩니다. 메일 링리스트에 대해 알아보십시오. 우리는 dict을 호환 가능한 조합 만 함께 dict의 목록으로 변경할 수 있습니다. 'tuned_parameters'와 같은 것 : http : //scikit-learn.org/stable/auto_examples/model_selection/grid_search_digits.html#sphx-glr-auto-examples-model-selection-grid-search-digits-py –
아, 멋지네요. , 그것은 간단한 해결책입니다! 감사 :) –