[머신러닝] Support Vector Machine(SVM) 4

Support Vector Machine(SVM)-GridsearchCV, RandomizedSearchCV

sklearnGridsearchCV, RandomizedSearchCV 을 활용해 최적의 hyperpamameter Cgamma를 찾는법에 대해서 알아본다.

Libray 및 DataSet(bmi DataSet)

필요한 Libray들을 불러오고 bmi.csv를 불러와 활용한다.

import numpy as np
import pandas as pd

from sklearn.svm import SVC
from sklearn.model_selection import GridsearchCV, RandomizedSearchCV

from scipy.stats import expon, reciprocal # 밑에 scipy.stats 에 있는 exponential함수와 분수 log함수다.
df= pd.read_csv('./data/bmi.csv', skiprows=3)

x_data = df[['height', 'weight']].values
t_data = df['label'].values

num_of_sample = 30

x_data_red = x_data[t_data==0][:num_of_sample]
t_data_red = t_data[t_data==0][:num_of_sample]

x_data_blue = x_data[t_data==1][:num_of_sample]
t_data_blue = t_data[t_data==1][:num_of_sample]

x_data_green = x_data[t_data==2][:num_of_sample]
t_data_green = t_data[t_data==2][:num_of_sample]


x_data_sample = np.concatenate((x_data_red, x_data_blue, x_data_green), axis=0)
t_data_sample = np.concatenate((t_data_red, t_data_blue, t_data_green), axis=0)

GridsearchCV 활용

GridSearchCV 활용법을 코드를 통해서 알아본다.

model = SVC()

param = [{'kernel':['linear'],
          'C' : [0.1, 10, 50 ,100, 500 ,1000]},
		 {'kernel':['rbf'],
          'C' : [0.1, 10, 50 ,100, 500 ,1000],
          'gamma' : [0.01, 0.005 , 0.1, 0.5, 1, 5, 10, 50]}]

gcv = GridSearchCV(model, param, cv=5, scoring='accuracy', verbose=2)
## cv : cross-validataion
## scoring : accuracy 를 확인하게 해준다.
## verbose : run 하면서 결과를 배출한다.
  Fitting 5 folds for each of 54 candidates, totalling 270 fits
  [CV] C=0.1, kernel=linear ............................................
  [CV] ............................. C=0.1, kernel=linear, total=   0.0s
  [CV] C=0.1, kernel=linear ............................................
  [CV] ............................. C=0.1, kernel=linear, total=   0.0s
  [CV] C=0.1, kernel=linear ............................................
  [CV] ............................. C=0.1, kernel=linear, total=   0.0s
  [CV] C=0.1, kernel=linear ............................................
  [CV] ............................. C=0.1, kernel=linear, total=   0.0s
  [CV] C=0.1, kernel=linear ............................................
  [CV] ............................. C=0.1, kernel=linear, total=   0.0s
  [CV] C=10, kernel=linear .............................................
  [CV] .............................. C=10, kernel=linear, total=   0.0s
  [CV] C=10, kernel=linear .............................................
  [CV] .............................. C=10, kernel=linear, total=   0.0s
  [CV] C=10, kernel=linear .............................................
  [CV] .............................. C=10, kernel=linear, total=   0.0s
  [CV] C=10, kernel=linear .............................................
  [CV] .............................. C=10, kernel=linear, total=   0.0s
  [CV] C=10, kernel=linear .............................................
  [CV] .............................. C=10, kernel=linear, total=   0.0s
  [CV] C=50, kernel=linear .............................................
  [CV] .............................. C=50, kernel=linear, total=   0.0s
  [CV] C=50, kernel=linear .............................................
  [CV] .............................. C=50, kernel=linear, total=   0.0s
  [CV] C=50, kernel=linear .............................................
  [CV] .............................. C=50, kernel=linear, total=   0.0s
  [CV] C=50, kernel=linear .............................................
  [CV] .............................. C=50, kernel=linear, total=   0.0s
  [CV] C=50, kernel=linear .............................................
  [CV] .............................. C=50, kernel=linear, total=   0.0s
  [CV] C=100, kernel=linear ............................................
  [CV] ............................. C=100, kernel=linear, total=   0.0s
  [CV] C=100, kernel=linear ............................................
  [CV] ............................. C=100, kernel=linear, total=   0.0s
  [CV] C=100, kernel=linear ............................................
  [CV] ............................. C=100, kernel=linear, total=   0.0s
  [CV] C=100, kernel=linear ............................................
  [CV] ............................. C=100, kernel=linear, total=   0.0s
  [CV] C=100, kernel=linear ............................................
  [CV] ............................. C=100, kernel=linear, total=   0.0s
  [CV] C=500, kernel=linear ............................................
  [CV] ............................. C=500, kernel=linear, total=   0.0s
  [CV] C=500, kernel=linear ............................................
  [CV] ............................. C=500, kernel=linear, total=   0.0s
  [CV] C=500, kernel=linear ............................................
  [CV] ............................. C=500, kernel=linear, total=   0.0s
  [CV] C=500, kernel=linear ............................................
  [CV] ............................. C=500, kernel=linear, total=   0.0s
  [CV] C=500, kernel=linear ............................................
  [CV] ............................. C=500, kernel=linear, total=   0.0s
  [CV] C=1000, kernel=linear ...........................................
  [CV] ............................ C=1000, kernel=linear, total=   0.0s
  [CV] C=1000, kernel=linear ...........................................
  [CV] ............................ C=1000, kernel=linear, total=   0.0s
  [CV] C=1000, kernel=linear ...........................................
  [CV] ............................ C=1000, kernel=linear, total=   0.0s
  [CV] C=1000, kernel=linear ...........................................
  [CV] ............................ C=1000, kernel=linear, total=   0.0s
  [CV] C=1000, kernel=linear ...........................................
  [CV] ............................ C=1000, kernel=linear, total=   0.0s
  [CV] C=0.1, gamma=0.01, kernel=rbf ...................................
  [CV] .................... C=0.1, gamma=0.01, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.01, kernel=rbf ...................................
  [CV] .................... C=0.1, gamma=0.01, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.01, kernel=rbf ...................................
  [CV] .................... C=0.1, gamma=0.01, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.01, kernel=rbf ...................................
  [CV] .................... C=0.1, gamma=0.01, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.01, kernel=rbf ...................................
  [CV] .................... C=0.1, gamma=0.01, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.005, kernel=rbf ..................................
  [CV] ................... C=0.1, gamma=0.005, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.005, kernel=rbf ..................................
  [CV] ................... C=0.1, gamma=0.005, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.005, kernel=rbf ..................................
  [CV] ................... C=0.1, gamma=0.005, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.005, kernel=rbf ..................................
  [CV] ................... C=0.1, gamma=0.005, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.005, kernel=rbf ..................................
  [CV] ................... C=0.1, gamma=0.005, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.1, kernel=rbf ....................................
  [CV] ..................... C=0.1, gamma=0.1, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.1, kernel=rbf ....................................
  [CV] ..................... C=0.1, gamma=0.1, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.1, kernel=rbf ....................................
  [CV] ..................... C=0.1, gamma=0.1, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.1, kernel=rbf ....................................
  [CV] ..................... C=0.1, gamma=0.1, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.1, kernel=rbf ....................................
  [CV] ..................... C=0.1, gamma=0.1, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.5, kernel=rbf ....................................
  [CV] ..................... C=0.1, gamma=0.5, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.5, kernel=rbf ....................................
  [CV] ..................... C=0.1, gamma=0.5, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.5, kernel=rbf ....................................
  [CV] ..................... C=0.1, gamma=0.5, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.5, kernel=rbf ....................................
  [CV] ..................... C=0.1, gamma=0.5, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=0.5, kernel=rbf ....................................
  [CV] ..................... C=0.1, gamma=0.5, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=1, kernel=rbf ......................................
  [CV] ....................... C=0.1, gamma=1, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=1, kernel=rbf ......................................
  [CV] ....................... C=0.1, gamma=1, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=1, kernel=rbf ......................................
  [CV] ....................... C=0.1, gamma=1, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=1, kernel=rbf ......................................
  [CV] ....................... C=0.1, gamma=1, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=1, kernel=rbf ......................................
  [CV] ....................... C=0.1, gamma=1, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=5, kernel=rbf ......................................
  [CV] ....................... C=0.1, gamma=5, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=5, kernel=rbf ......................................
  [CV] ....................... C=0.1, gamma=5, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=5, kernel=rbf ......................................
  [CV] ....................... C=0.1, gamma=5, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=5, kernel=rbf ......................................
  [CV] ....................... C=0.1, gamma=5, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=5, kernel=rbf ......................................
  [CV] ....................... C=0.1, gamma=5, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=10, kernel=rbf .....................................
  [CV] ...................... C=0.1, gamma=10, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=10, kernel=rbf .....................................
  [CV] ...................... C=0.1, gamma=10, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=10, kernel=rbf .....................................
  [CV] ...................... C=0.1, gamma=10, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=10, kernel=rbf .....................................
  [CV] ...................... C=0.1, gamma=10, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=10, kernel=rbf .....................................
  [CV] ...................... C=0.1, gamma=10, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=50, kernel=rbf .....................................
  [CV] ...................... C=0.1, gamma=50, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=50, kernel=rbf .....................................
  [CV] ...................... C=0.1, gamma=50, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=50, kernel=rbf .....................................
  [CV] ...................... C=0.1, gamma=50, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=50, kernel=rbf .....................................
  [CV] ...................... C=0.1, gamma=50, kernel=rbf, total=   0.0s
  [CV] C=0.1, gamma=50, kernel=rbf .....................................
  [CV] ...................... C=0.1, gamma=50, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.01, kernel=rbf ....................................
  [CV] ..................... C=10, gamma=0.01, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.01, kernel=rbf ....................................
  [CV] ..................... C=10, gamma=0.01, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.01, kernel=rbf ....................................
  [CV] ..................... C=10, gamma=0.01, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.01, kernel=rbf ....................................
  [CV] ..................... C=10, gamma=0.01, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.01, kernel=rbf ....................................
  [CV] ..................... C=10, gamma=0.01, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.005, kernel=rbf ...................................
  [CV] .................... C=10, gamma=0.005, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.005, kernel=rbf ...................................
  [CV] .................... C=10, gamma=0.005, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.005, kernel=rbf ...................................
  [CV] .................... C=10, gamma=0.005, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.005, kernel=rbf ...................................
  [CV] .................... C=10, gamma=0.005, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.005, kernel=rbf ...................................
  [CV] .................... C=10, gamma=0.005, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.1, kernel=rbf .....................................
  [CV] ...................... C=10, gamma=0.1, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.1, kernel=rbf .....................................
  [CV] ...................... C=10, gamma=0.1, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.1, kernel=rbf .....................................
  [CV] ...................... C=10, gamma=0.1, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.1, kernel=rbf .....................................
  [CV] ...................... C=10, gamma=0.1, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.1, kernel=rbf .....................................
  [CV] ...................... C=10, gamma=0.1, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.5, kernel=rbf .....................................
  [CV] ...................... C=10, gamma=0.5, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.5, kernel=rbf .....................................
  [CV] ...................... C=10, gamma=0.5, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.5, kernel=rbf .....................................
  [CV] ...................... C=10, gamma=0.5, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.5, kernel=rbf .....................................
  [CV] ...................... C=10, gamma=0.5, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=0.5, kernel=rbf .....................................
  [CV] ...................... C=10, gamma=0.5, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=1, kernel=rbf .......................................
  [CV] ........................ C=10, gamma=1, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=1, kernel=rbf .......................................
  [CV] ........................ C=10, gamma=1, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=1, kernel=rbf .......................................
  [CV] ........................ C=10, gamma=1, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=1, kernel=rbf .......................................
  [CV] ........................ C=10, gamma=1, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=1, kernel=rbf .......................................
  [CV] ........................ C=10, gamma=1, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=5, kernel=rbf .......................................
  [CV] ........................ C=10, gamma=5, kernel=rbf, total=   0.0s
  [CV] C=10, gamma=5, kernel=rbf .......................................
print(gcv.best_params_)
print(gcv.best_score_)
## {'C': 10, 'kernel': 'linear'}
## 0.9333333333333333

RandomsearchCV 활용

RandomSearchCV 활용법을 코드를 통해서 알아본다.

model = SCV()
param = {'kernel':['linear', 'rbf'],
        'C':reciprocal(20,20000),
        'gamma':expon(scale=1.0)}

rcv = RandomsizedSearchCV(model, param, cv=5, scoring='accuracy', ,n_iter=100, verbose=2)
rcv.fit(x_data_sample, t_data_sample)
  Fitting 5 folds for each of 100 candidates, totalling 500 fits
[CV] C=284.57377084740676, gamma=0.368467801842947, kernel=linear ....
[CV]  C=284.57377084740676, gamma=0.368467801842947, kernel=linear, total=   0.0s
[CV] C=284.57377084740676, gamma=0.368467801842947, kernel=linear ....
[CV]  C=284.57377084740676, gamma=0.368467801842947, kernel=linear, total=   0.0s
[CV] C=284.57377084740676, gamma=0.368467801842947, kernel=linear ....
[CV]  C=284.57377084740676, gamma=0.368467801842947, kernel=linear, total=   0.0s
[CV] C=284.57377084740676, gamma=0.368467801842947, kernel=linear ....
[CV]  C=284.57377084740676, gamma=0.368467801842947, kernel=linear, total=   0.0s
[CV] C=284.57377084740676, gamma=0.368467801842947, kernel=linear ....
[CV]  C=284.57377084740676, gamma=0.368467801842947, kernel=linear, total=   0.0s
[CV] C=251.76897715327834, gamma=0.1438362524715869, kernel=rbf ......
[CV]  C=251.76897715327834, gamma=0.1438362524715869, kernel=rbf, total=   0.0s
[CV] C=251.76897715327834, gamma=0.1438362524715869, kernel=rbf ......
[CV]  C=251.76897715327834, gamma=0.1438362524715869, kernel=rbf, total=   0.0s
[CV] C=251.76897715327834, gamma=0.1438362524715869, kernel=rbf ......
[CV]  C=251.76897715327834, gamma=0.1438362524715869, kernel=rbf, total=   0.0s
[CV] C=251.76897715327834, gamma=0.1438362524715869, kernel=rbf ......
[CV]  C=251.76897715327834, gamma=0.1438362524715869, kernel=rbf, total=   0.0s
[CV] C=251.76897715327834, gamma=0.1438362524715869, kernel=rbf ......
[CV]  C=251.76897715327834, gamma=0.1438362524715869, kernel=rbf, total=   0.0s
[CV] C=21.308212450576423, gamma=0.24952574100888486, kernel=linear ..
[CV]  C=21.308212450576423, gamma=0.24952574100888486, kernel=linear, total=   0.0s
[CV] C=21.308212450576423, gamma=0.24952574100888486, kernel=linear ..
[CV]  C=21.308212450576423, gamma=0.24952574100888486, kernel=linear, total=   0.0s
[CV] C=21.308212450576423, gamma=0.24952574100888486, kernel=linear ..
[CV]  C=21.308212450576423, gamma=0.24952574100888486, kernel=linear, total=   0.0s
[CV] C=21.308212450576423, gamma=0.24952574100888486, kernel=linear ..
[CV]  C=21.308212450576423, gamma=0.24952574100888486, kernel=linear, total=   0.0s
[CV] C=21.308212450576423, gamma=0.24952574100888486, kernel=linear ..
[CV]  C=21.308212450576423, gamma=0.24952574100888486, kernel=linear, total=   0.0s
[CV] C=300.496925612321, gamma=1.7376643818627768, kernel=rbf ........
[CV]  C=300.496925612321, gamma=1.7376643818627768, kernel=rbf, total=   0.0s
[CV] C=300.496925612321, gamma=1.7376643818627768, kernel=rbf ........
[CV]  C=300.496925612321, gamma=1.7376643818627768, kernel=rbf, total=   0.0s
[CV] C=300.496925612321, gamma=1.7376643818627768, kernel=rbf ........
[CV]  C=300.496925612321, gamma=1.7376643818627768, kernel=rbf, total=   0.0s
[CV] C=300.496925612321, gamma=1.7376643818627768, kernel=rbf ........
[CV]  C=300.496925612321, gamma=1.7376643818627768, kernel=rbf, total=   0.0s
[CV] C=300.496925612321, gamma=1.7376643818627768, kernel=rbf ........
[CV]  C=300.496925612321, gamma=1.7376643818627768, kernel=rbf, total=   0.0s
[CV] C=300.12630354809016, gamma=0.030852169827219715, kernel=rbf ....
[CV]  C=300.12630354809016, gamma=0.030852169827219715, kernel=rbf, total=   0.0s
[CV] C=300.12630354809016, gamma=0.030852169827219715, kernel=rbf ....
[CV]  C=300.12630354809016, gamma=0.030852169827219715, kernel=rbf, total=   0.0s
[CV] C=300.12630354809016, gamma=0.030852169827219715, kernel=rbf ....
[CV]  C=300.12630354809016, gamma=0.030852169827219715, kernel=rbf, total=   0.0s
[CV] C=300.12630354809016, gamma=0.030852169827219715, kernel=rbf ....
[CV]  C=300.12630354809016, gamma=0.030852169827219715, kernel=rbf, total=   0.0s
[CV] C=300.12630354809016, gamma=0.030852169827219715, kernel=rbf ....
[CV]  C=300.12630354809016, gamma=0.030852169827219715, kernel=rbf, total=   0.0s
[CV] C=6101.085593114175, gamma=0.32134018877237464, kernel=linear ...
[CV]  C=6101.085593114175, gamma=0.32134018877237464, kernel=linear, total=   0.0s
[CV] C=6101.085593114175, gamma=0.32134018877237464, kernel=linear ...
[CV]  C=6101.085593114175, gamma=0.32134018877237464, kernel=linear, total=   0.0s
[CV] C=6101.085593114175, gamma=0.32134018877237464, kernel=linear ...
[CV]  C=6101.085593114175, gamma=0.32134018877237464, kernel=linear, total=   0.0s
[CV] C=6101.085593114175, gamma=0.32134018877237464, kernel=linear ...
[CV]  C=6101.085593114175, gamma=0.32134018877237464, kernel=linear, total=   0.0s
[CV] C=6101.085593114175, gamma=0.32134018877237464, kernel=linear ...
[CV]  C=6101.085593114175, gamma=0.32134018877237464, kernel=linear, total=   0.0s
[CV] C=73.8415423750911, gamma=2.0630632509351807, kernel=rbf ........
[CV]  C=73.8415423750911, gamma=2.0630632509351807, kernel=rbf, total=   0.0s
[CV] C=73.8415423750911, gamma=2.0630632509351807, kernel=rbf ........
[CV]  C=73.8415423750911, gamma=2.0630632509351807, kernel=rbf, total=   0.0s
[CV] C=73.8415423750911, gamma=2.0630632509351807, kernel=rbf ........
[CV]  C=73.8415423750911, gamma=2.0630632509351807, kernel=rbf, total=   0.0s
[CV] C=73.8415423750911, gamma=2.0630632509351807, kernel=rbf ........
[CV]  C=73.8415423750911, gamma=2.0630632509351807, kernel=rbf, total=   0.0s
[CV] C=73.8415423750911, gamma=2.0630632509351807, kernel=rbf ........
[CV]  C=73.8415423750911, gamma=2.0630632509351807, kernel=rbf, total=   0.0s
[CV] C=1214.5883077117546, gamma=0.7224529118532779, kernel=rbf ......
[CV]  C=1214.5883077117546, gamma=0.7224529118532779, kernel=rbf, total=   0.0s
[CV] C=1214.5883077117546, gamma=0.7224529118532779, kernel=rbf ......
[CV]  C=1214.5883077117546, gamma=0.7224529118532779, kernel=rbf, total=   0.0s
[CV] C=1214.5883077117546, gamma=0.7224529118532779, kernel=rbf ......
[CV]  C=1214.5883077117546, gamma=0.7224529118532779, kernel=rbf, total=   0.0s
[CV] C=1214.5883077117546, gamma=0.7224529118532779, kernel=rbf ......
[CV]  C=1214.5883077117546, gamma=0.7224529118532779, kernel=rbf, total=   0.0s
[CV] C=1214.5883077117546, gamma=0.7224529118532779, kernel=rbf ......
[CV]  C=1214.5883077117546, gamma=0.7224529118532779, kernel=rbf, total=   0.0s
[CV] C=239.22655726386284, gamma=1.0702479829006921, kernel=rbf ......
[CV]  C=239.22655726386284, gamma=1.0702479829006921, kernel=rbf, total=   0.0s
[CV] C=239.22655726386284, gamma=1.0702479829006921, kernel=rbf ......
[CV]  C=239.22655726386284, gamma=1.0702479829006921, kernel=rbf, total=   0.0s
[CV] C=239.22655726386284, gamma=1.0702479829006921, kernel=rbf ......
[CV]  C=239.22655726386284, gamma=1.0702479829006921, kernel=rbf, total=   0.0s
[CV] C=239.22655726386284, gamma=1.0702479829006921, kernel=rbf ......
[CV]  C=239.22655726386284, gamma=1.0702479829006921, kernel=rbf, total=   0.0s
[CV] C=239.22655726386284, gamma=1.0702479829006921, kernel=rbf ......
[CV]  C=239.22655726386284, gamma=1.0702479829006921, kernel=rbf, total=   0.0s
[CV] C=8037.525786261154, gamma=0.8033566399397343, kernel=rbf .......
[CV]  C=8037.525786261154, gamma=0.8033566399397343, kernel=rbf, total=   0.0s
[CV] C=8037.525786261154, gamma=0.8033566399397343, kernel=rbf .......
[CV]  C=8037.525786261154, gamma=0.8033566399397343, kernel=rbf, total=   0.0s
[CV] C=8037.525786261154, gamma=0.8033566399397343, kernel=rbf .......
[CV]  C=8037.525786261154, gamma=0.8033566399397343, kernel=rbf, total=   0.0s
[CV] C=8037.525786261154, gamma=0.8033566399397343, kernel=rbf .......
[CV]  C=8037.525786261154, gamma=0.8033566399397343, kernel=rbf, total=   0.0s
[CV] C=8037.525786261154, gamma=0.8033566399397343, kernel=rbf .......
[CV]  C=8037.525786261154, gamma=0.8033566399397343, kernel=rbf, total=   0.0s
[CV] C=1578.5538821411308, gamma=0.4070888735292457, kernel=rbf ......
[CV]  C=1578.5538821411308, gamma=0.4070888735292457, kernel=rbf, total=   0.0s
[CV] C=1578.5538821411308, gamma=0.4070888735292457, kernel=rbf ......
[CV]  C=1578.5538821411308, gamma=0.4070888735292457, kernel=rbf, total=   0.0s
[CV] C=1578.5538821411308, gamma=0.4070888735292457, kernel=rbf ......
[CV]  C=1578.5538821411308, gamma=0.4070888735292457, kernel=rbf, total=   0.0s
[CV] C=1578.5538821411308, gamma=0.4070888735292457, kernel=rbf ......
[CV]  C=1578.5538821411308, gamma=0.4070888735292457, kernel=rbf, total=   0.0s
[CV] C=1578.5538821411308, gamma=0.4070888735292457, kernel=rbf ......
[CV]  C=1578.5538821411308, gamma=0.4070888735292457, kernel=rbf, total=   0.0s
[CV] C=106.16241951580452, gamma=0.9311437695756346, kernel=rbf ......
[CV]  C=106.16241951580452, gamma=0.9311437695756346, kernel=rbf, total=   0.0s
[CV] C=106.16241951580452, gamma=0.9311437695756346, kernel=rbf ......
[CV]  C=106.16241951580452, gamma=0.9311437695756346, kernel=rbf, total=   0.0s
[CV] C=106.16241951580452, gamma=0.9311437695756346, kernel=rbf ......
[CV]  C=106.16241951580452, gamma=0.9311437695756346, kernel=rbf, total=   0.0s
[CV] C=106.16241951580452, gamma=0.9311437695756346, kernel=rbf ......
[CV]  C=106.16241951580452, gamma=0.9311437695756346, kernel=rbf, total=   0.0s
[CV] C=106.16241951580452, gamma=0.9311437695756346, kernel=rbf ......
[CV]  C=106.16241951580452, gamma=0.9311437695756346, kernel=rbf, total=   0.0s
[CV] C=57.57750940435712, gamma=1.1258459347092866, kernel=rbf .......
[CV]  C=57.57750940435712, gamma=1.1258459347092866, kernel=rbf, total=   0.0s
[CV] C=57.57750940435712, gamma=1.1258459347092866, kernel=rbf .......
[CV]  C=57.57750940435712, gamma=1.1258459347092866, kernel=rbf, total=   0.0s
[CV] C=57.57750940435712, gamma=1.1258459347092866, kernel=rbf .......
[CV]  C=57.57750940435712, gamma=1.1258459347092866, kernel=rbf, total=   0.0s
[CV] C=57.57750940435712, gamma=1.1258459347092866, kernel=rbf .......
[CV]  C=57.57750940435712, gamma=1.1258459347092866, kernel=rbf, total=   0.0s
[CV] C=57.57750940435712, gamma=1.1258459347092866, kernel=rbf .......
[CV]  C=57.57750940435712, gamma=1.1258459347092866, kernel=rbf, total=   0.0s
[CV] C=11007.980944734516, gamma=0.700035801442345, kernel=rbf .......
[CV]  C=11007.980944734516, gamma=0.700035801442345, kernel=rbf, total=   0.0s
[CV] C=11007.980944734516, gamma=0.700035801442345, kernel=rbf .......
[CV]  C=11007.980944734516, gamma=0.700035801442345, kernel=rbf, total=   0.0s
[CV] C=11007.980944734516, gamma=0.700035801442345, kernel=rbf .......
[CV]  C=11007.980944734516, gamma=0.700035801442345, kernel=rbf, total=   0.0s
[CV] C=11007.980944734516, gamma=0.700035801442345, kernel=rbf .......
[CV]  C=11007.980944734516, gamma=0.700035801442345, kernel=rbf, total=   0.0s
[CV] C=11007.980944734516, gamma=0.700035801442345, kernel=rbf .......
[CV]  C=11007.980944734516, gamma=0.700035801442345, kernel=rbf, total=   0.0s
[CV] C=35.92016674092604, gamma=0.4499296939688913, kernel=linear ....
[CV]  C=35.92016674092604, gamma=0.4499296939688913, kernel=linear, total=   0.0s
[CV] C=35.92016674092604, gamma=0.4499296939688913, kernel=linear ....
[CV]  C=35.92016674092604, gamma=0.4499296939688913, kernel=linear, total=   0.0s
[CV] C=35.92016674092604, gamma=0.4499296939688913, kernel=linear ....
[CV]  C=35.92016674092604, gamma=0.4499296939688913, kernel=linear, total=   0.0s
[CV] C=35.92016674092604, gamma=0.4499296939688913, kernel=linear ....
[CV]  C=35.92016674092604, gamma=0.4499296939688913, kernel=linear, total=   0.0s
[CV] C=35.92016674092604, gamma=0.4499296939688913, kernel=linear ....
[CV]  C=35.92016674092604, gamma=0.4499296939688913, kernel=linear, total=   0.0s
[CV] C=1187.0415191016034, gamma=1.0591480514746816, kernel=linear ...
[CV]  C=1187.0415191016034, gamma=1.0591480514746816, kernel=linear, total=   0.0s
[CV] C=1187.0415191016034, gamma=1.0591480514746816, kernel=linear ...
[CV]  C=1187.0415191016034, gamma=1.0591480514746816, kernel=linear, total=   0.0s
[CV] C=1187.0415191016034, gamma=1.0591480514746816, kernel=linear ...
[CV]  C=1187.0415191016034, gamma=1.0591480514746816, kernel=linear, total=   0.0s
[CV] C=1187.0415191016034, gamma=1.0591480514746816, kernel=linear ...
[CV]  C=1187.0415191016034, gamma=1.0591480514746816, kernel=linear, total=   0.0s
[CV] C=1187.0415191016034, gamma=1.0591480514746816, kernel=linear ...
[CV]  C=1187.0415191016034, gamma=1.0591480514746816, kernel=linear, total=   0.0s
[CV] C=443.79852969369574, gamma=1.170728542170378, kernel=linear ....
[CV]  C=443.79852969369574, gamma=1.170728542170378, kernel=linear, total=   0.0s
[CV] C=443.79852969369574, gamma=1.170728542170378, kernel=linear ....
[CV]  C=443.79852969369574, gamma=1.170728542170378, kernel=linear, total=   0.0s
[CV] C=443.79852969369574, gamma=1.170728542170378, kernel=linear ....
[CV]  C=443.79852969369574, gamma=1.170728542170378, kernel=linear, total=   0.0s
[CV] C=443.79852969369574, gamma=1.170728542170378, kernel=linear ....
[CV]  C=443.79852969369574, gamma=1.170728542170378, kernel=linear, total=   0.0s
[CV] C=443.79852969369574, gamma=1.170728542170378, kernel=linear ....
[CV]  C=443.79852969369574, gamma=1.170728542170378, kernel=linear, total=   0.0s
[CV] C=227.28149059953753, gamma=1.0861793746659385, kernel=linear ...
[CV]  C=227.28149059953753, gamma=1.0861793746659385, kernel=linear, total=   0.0s
[CV] C=227.28149059953753, gamma=1.0861793746659385, kernel=linear ...
[CV]  C=227.28149059953753, gamma=1.0861793746659385, kernel=linear, total=   0.0s
[CV] C=227.28149059953753, gamma=1.0861793746659385, kernel=linear ...
[CV]  C=227.28149059953753, gamma=1.0861793746659385, kernel=linear, total=   0.0s
[CV] C=227.28149059953753, gamma=1.0861793746659385, kernel=linear ...
[CV]  C=227.28149059953753, gamma=1.0861793746659385, kernel=linear, total=   0.0s
[CV] C=227.28149059953753, gamma=1.0861793746659385, kernel=linear ...
[CV]  C=227.28149059953753, gamma=1.0861793746659385, kernel=linear, total=   0.0s
[CV] C=62.79674994226554, gamma=2.189279880168254, kernel=linear .....
[CV]  C=62.79674994226554, gamma=2.189279880168254, kernel=linear, total=   0.0s
[CV] C=62.79674994226554, gamma=2.189279880168254, kernel=linear .....
[CV]  C=62.79674994226554, gamma=2.189279880168254, kernel=linear, total=   0.0s
[CV] C=62.79674994226554, gamma=2.189279880168254, kernel=linear .....
[CV]  C=62.79674994226554, gamma=2.189279880168254, kernel=linear, total=   0.0s
[CV] C=62.79674994226554, gamma=2.189279880168254, kernel=linear .....
[CV]  C=62.79674994226554, gamma=2.189279880168254, kernel=linear, total=   0.0s
[CV] C=62.79674994226554, gamma=2.189279880168254, kernel=linear .....
print(rcv.best_score_)
print(rcv.best_params_)
## 0.9333333333333333
## {'C': 284.57377084740676, 'gamma': 0.368467801842947, 'kernel': 'linear'}