In [1]:
import os
import pandas as pd
import matplotlib.pyplot as plt
import seaborn.apionly as sns
from sklearn.model_selection import GridSearchCV

import comptools as comp

%matplotlib inline


/home/jbourbeau/.virtualenvs/composition/lib/python2.7/site-packages/sklearn/cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
  "This module will be removed in 0.20.", DeprecationWarning)

In [2]:
# Load simulation data and pipeline
df_sim_train, df_sim_test = comp.load_sim(config='IC86.2012')
feature_list, feature_labels = comp.analysis.get_training_features()
pipeline = comp.get_pipeline('BDT')

In [3]:
feature_list


Out[3]:
['lap_cos_zenith',
 'log_s125',
 'log_dEdX',
 'log_d4r_peak_energy',
 'log_d4r_peak_sigma']

In [4]:
pipeline.get_params().keys()


Out[4]:
['classifier__min_impurity_split',
 'classifier__max_features',
 'classifier__subsample',
 'classifier__max_depth',
 'classifier__min_samples_split',
 'classifier__learning_rate',
 'classifier__min_samples_leaf',
 'classifier__criterion',
 'classifier__loss',
 'classifier__n_estimators',
 'classifier__max_leaf_nodes',
 'steps',
 'classifier__warm_start',
 'classifier__verbose',
 'classifier__presort',
 'classifier__min_weight_fraction_leaf',
 'classifier',
 'classifier__random_state',
 'classifier__init']

In [5]:
parameters = {'classifier__max_depth': range(1, 11), 
              'classifier__n_estimators':[5, 10, 20, 50, 100, 200, 300, 400, 500, 600]}

# parameters = {'classifier__max_depth': range(1, 8), 
#               'classifier__n_estimators':[5, 10, 20, 50, 100, 200, 300, 400, 500, 600]}

grid_search = GridSearchCV(pipeline, parameters, n_jobs=25, verbose=2)
grid_search.fit(df_sim_train[feature_list], df_sim_train['target'])


Fitting 3 folds for each of 100 candidates, totalling 300 fits
[CV] classifier__n_estimators=5, classifier__max_depth=1 .............
[CV] classifier__n_estimators=5, classifier__max_depth=1 .............
[CV] classifier__n_estimators=5, classifier__max_depth=1 .............
[CV] classifier__n_estimators=10, classifier__max_depth=1 ............
[CV]  classifier__n_estimators=5, classifier__max_depth=1, total=   0.1s
[CV] classifier__n_estimators=10, classifier__max_depth=1 ............
[CV] classifier__n_estimators=10, classifier__max_depth=1 ............
[CV] classifier__n_estimators=20, classifier__max_depth=1 ............
[CV] classifier__n_estimators=20, classifier__max_depth=1 ............
[CV]  classifier__n_estimators=5, classifier__max_depth=1, total=   0.1s
[CV] classifier__n_estimators=20, classifier__max_depth=1 ............
[CV] classifier__n_estimators=50, classifier__max_depth=1 ............
[CV] classifier__n_estimators=50, classifier__max_depth=1 ............
[CV]  classifier__n_estimators=5, classifier__max_depth=1, total=   0.1s
[CV] classifier__n_estimators=50, classifier__max_depth=1 ............
[CV] classifier__n_estimators=100, classifier__max_depth=1 ...........
[CV] classifier__n_estimators=100, classifier__max_depth=1 ...........
[CV] classifier__n_estimators=100, classifier__max_depth=1 ...........
[CV] classifier__n_estimators=200, classifier__max_depth=1 ...........
[CV] classifier__n_estimators=200, classifier__max_depth=1 ...........
[CV]  classifier__n_estimators=10, classifier__max_depth=1, total=   0.2s
[CV] classifier__n_estimators=300, classifier__max_depth=1 ...........
[CV] classifier__n_estimators=200, classifier__max_depth=1 ...........
[CV]  classifier__n_estimators=10, classifier__max_depth=1, total=   0.2s
[CV] classifier__n_estimators=300, classifier__max_depth=1 ...........
[CV] classifier__n_estimators=300, classifier__max_depth=1 ...........
[CV] classifier__n_estimators=400, classifier__max_depth=1 ...........
[CV] classifier__n_estimators=400, classifier__max_depth=1 ...........
[CV] classifier__n_estimators=400, classifier__max_depth=1 ...........
[CV]  classifier__n_estimators=10, classifier__max_depth=1, total=   0.3s
[CV] classifier__n_estimators=500, classifier__max_depth=1 ...........
[CV] classifier__n_estimators=500, classifier__max_depth=1 ...........
[CV] classifier__n_estimators=500, classifier__max_depth=1 ...........
[CV] classifier__n_estimators=600, classifier__max_depth=1 ...........
[CV] classifier__n_estimators=600, classifier__max_depth=1 ...........
[CV] classifier__n_estimators=600, classifier__max_depth=1 ...........
[CV] classifier__n_estimators=5, classifier__max_depth=2 .............
[CV]  classifier__n_estimators=20, classifier__max_depth=1, total=   0.5s
[CV] classifier__n_estimators=5, classifier__max_depth=2 .............
[CV]  classifier__n_estimators=20, classifier__max_depth=1, total=   0.5s
[CV] classifier__n_estimators=5, classifier__max_depth=2 .............
[CV]  classifier__n_estimators=20, classifier__max_depth=1, total=   0.6s
[CV] classifier__n_estimators=10, classifier__max_depth=2 ............
[CV]  classifier__n_estimators=5, classifier__max_depth=2, total=   0.3s
[CV] classifier__n_estimators=10, classifier__max_depth=2 ............
[CV]  classifier__n_estimators=5, classifier__max_depth=2, total=   0.2s
[CV] classifier__n_estimators=10, classifier__max_depth=2 ............
[CV]  classifier__n_estimators=5, classifier__max_depth=2, total=   0.3s
[CV] classifier__n_estimators=20, classifier__max_depth=2 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=2, total=   0.5s
[CV] classifier__n_estimators=20, classifier__max_depth=2 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=2, total=   0.5s
[CV] classifier__n_estimators=20, classifier__max_depth=2 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=2, total=   0.4s
[CV] classifier__n_estimators=50, classifier__max_depth=2 ............
[CV]  classifier__n_estimators=50, classifier__max_depth=1, total=   1.3s
[CV] classifier__n_estimators=50, classifier__max_depth=2 ............
[CV]  classifier__n_estimators=50, classifier__max_depth=1, total=   1.6s
[CV] classifier__n_estimators=50, classifier__max_depth=2 ............
[CV]  classifier__n_estimators=50, classifier__max_depth=1, total=   1.6s
[CV]  classifier__n_estimators=20, classifier__max_depth=2, total=   0.8s
[CV] classifier__n_estimators=100, classifier__max_depth=2 ...........
[CV] classifier__n_estimators=100, classifier__max_depth=2 ...........
[CV]  classifier__n_estimators=20, classifier__max_depth=2, total=   0.9s
[CV] classifier__n_estimators=100, classifier__max_depth=2 ...........
[CV]  classifier__n_estimators=20, classifier__max_depth=2, total=   1.1s
[CV] classifier__n_estimators=200, classifier__max_depth=2 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=1, total=   2.3s
[CV] classifier__n_estimators=200, classifier__max_depth=2 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=1, total=   2.7s
[CV] classifier__n_estimators=200, classifier__max_depth=2 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=1, total=   2.8s
[CV] classifier__n_estimators=300, classifier__max_depth=2 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=2, total=   1.6s
[CV] classifier__n_estimators=300, classifier__max_depth=2 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=2, total=   2.0s
[CV] classifier__n_estimators=300, classifier__max_depth=2 ...........
[CV]  classifier__n_estimators=200, classifier__max_depth=1, total=   4.1s
[CV] classifier__n_estimators=400, classifier__max_depth=2 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=2, total=   2.7s
[CV] classifier__n_estimators=500, classifier__max_depth=2 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=2, total=   3.3s
[CV] classifier__n_estimators=500, classifier__max_depth=2 ...........
[CV]  classifier__n_estimators=200, classifier__max_depth=1, total=   5.1s
[CV] classifier__n_estimators=600, classifier__max_depth=2 ...........
[CV]  classifier__n_estimators=200, classifier__max_depth=1, total=   5.4s
[CV] classifier__n_estimators=5, classifier__max_depth=3 .............
[CV]  classifier__n_estimators=100, classifier__max_depth=2, total=   3.9s
[CV] classifier__n_estimators=5, classifier__max_depth=3 .............
[CV]  classifier__n_estimators=5, classifier__max_depth=3, total=   0.3s
[CV] classifier__n_estimators=5, classifier__max_depth=3 .............
[CV]  classifier__n_estimators=5, classifier__max_depth=3, total=   0.3s
[CV] classifier__n_estimators=10, classifier__max_depth=3 ............
[CV]  classifier__n_estimators=5, classifier__max_depth=3, total=   0.3s
[CV] classifier__n_estimators=10, classifier__max_depth=3 ............
[CV]  classifier__n_estimators=100, classifier__max_depth=2, total=   4.2s
[CV] classifier__n_estimators=20, classifier__max_depth=3 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=3, total=   0.7s
[CV] classifier__n_estimators=20, classifier__max_depth=3 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=3, total=   0.6s
[CV] classifier__n_estimators=10, classifier__max_depth=3 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=3, total=   0.6s
[CV] classifier__n_estimators=50, classifier__max_depth=3 ............
[CV]  classifier__n_estimators=20, classifier__max_depth=3, total=   1.2s
[CV] classifier__n_estimators=20, classifier__max_depth=3 ............
[CV]  classifier__n_estimators=300, classifier__max_depth=1, total=   7.4s
[CV] classifier__n_estimators=100, classifier__max_depth=3 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=1, total=   7.6s
[CV] classifier__n_estimators=100, classifier__max_depth=3 ...........
[CV]  classifier__n_estimators=20, classifier__max_depth=3, total=   1.3s
[CV] classifier__n_estimators=50, classifier__max_depth=3 ............
[CV]  classifier__n_estimators=300, classifier__max_depth=1, total=   8.3s
[CV] classifier__n_estimators=200, classifier__max_depth=3 ...........
[CV]  classifier__n_estimators=20, classifier__max_depth=3, total=   1.3s
[CV] classifier__n_estimators=300, classifier__max_depth=3 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=1, total=   9.5s
[CV] classifier__n_estimators=300, classifier__max_depth=3 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=1, total=   9.9s
[CV] classifier__n_estimators=400, classifier__max_depth=3 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=1, total=  10.0s
[CV]  classifier__n_estimators=200, classifier__max_depth=2, total=   7.8s
[CV] classifier__n_estimators=500, classifier__max_depth=3 ...........
[CV] classifier__n_estimators=500, classifier__max_depth=3 ...........
[CV]  classifier__n_estimators=200, classifier__max_depth=2, total=   7.5s
[CV] classifier__n_estimators=600, classifier__max_depth=3 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=3, total=   3.2s
[CV] classifier__n_estimators=50, classifier__max_depth=3 ............
[CV]  classifier__n_estimators=500, classifier__max_depth=1, total=  10.7s
[CV] classifier__n_estimators=5, classifier__max_depth=4 .............
[CV]  classifier__n_estimators=50, classifier__max_depth=3, total=   3.1s
[CV] classifier__n_estimators=5, classifier__max_depth=4 .............
[CV]  classifier__n_estimators=5, classifier__max_depth=4, total=   0.4s
[CV] classifier__n_estimators=5, classifier__max_depth=4 .............
[CV]  classifier__n_estimators=5, classifier__max_depth=4, total=   0.4s
[CV] classifier__n_estimators=10, classifier__max_depth=4 ............
[CV]  classifier__n_estimators=5, classifier__max_depth=4, total=   0.4s
[CV] classifier__n_estimators=10, classifier__max_depth=4 ............
[CV]  classifier__n_estimators=500, classifier__max_depth=1, total=  11.9s
[CV] classifier__n_estimators=20, classifier__max_depth=4 ............
[CV]  classifier__n_estimators=200, classifier__max_depth=2, total=  10.0s
[CV] classifier__n_estimators=20, classifier__max_depth=4 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=4, total=   0.6s
[CV] classifier__n_estimators=50, classifier__max_depth=4 ............
[CV]  classifier__n_estimators=600, classifier__max_depth=1, total=  12.5s
[CV] classifier__n_estimators=100, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=10, classifier__max_depth=4, total=   1.0s
[CV] classifier__n_estimators=10, classifier__max_depth=4 ............
[CV]  classifier__n_estimators=100, classifier__max_depth=3, total=   5.6s
[CV] classifier__n_estimators=100, classifier__max_depth=3 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=3, total=   5.5s
[CV] classifier__n_estimators=200, classifier__max_depth=3 ...........
[CV]  classifier__n_estimators=20, classifier__max_depth=4, total=   1.4s
[CV] classifier__n_estimators=20, classifier__max_depth=4 ............
[CV]  classifier__n_estimators=20, classifier__max_depth=4, total=   1.4s
[CV] classifier__n_estimators=50, classifier__max_depth=4 ............
[CV]  classifier__n_estimators=500, classifier__max_depth=1, total=  13.7s
[CV]  classifier__n_estimators=10, classifier__max_depth=4, total=   0.9s
[CV] classifier__n_estimators=100, classifier__max_depth=4 ...........
[CV] classifier__n_estimators=200, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=3, total=   3.5s
[CV] classifier__n_estimators=300, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=2, total=  11.3s
[CV] classifier__n_estimators=300, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=20, classifier__max_depth=4, total=   1.6s
[CV] classifier__n_estimators=400, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=2, total=  12.6s
[CV] classifier__n_estimators=500, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=2, total=  12.5s
[CV] classifier__n_estimators=400, classifier__max_depth=2 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=4, total=   3.8s
[CV] classifier__n_estimators=50, classifier__max_depth=4 ............
[CV]  classifier__n_estimators=600, classifier__max_depth=1, total=  16.1s
[CV] classifier__n_estimators=500, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=600, classifier__max_depth=1, total=  17.0s
[CV] classifier__n_estimators=500, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=3, total=   5.5s
[CV] classifier__n_estimators=600, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=4, total=   5.2s
[CV] classifier__n_estimators=600, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=2, total=  15.6s
[CV] classifier__n_estimators=400, classifier__max_depth=2 ...........
[CV]  classifier__n_estimators=200, classifier__max_depth=3, total=  11.4s
[CV] classifier__n_estimators=200, classifier__max_depth=3 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=4, total=   3.7s
[CV] classifier__n_estimators=600, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=4, total=   7.6s
[CV] classifier__n_estimators=100, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=4, total=   7.6s
[CV] classifier__n_estimators=200, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=200, classifier__max_depth=3, total=  10.0s
[CV] classifier__n_estimators=5, classifier__max_depth=5 .............
[CV]  classifier__n_estimators=5, classifier__max_depth=5, total=   0.7s
[CV]  classifier__n_estimators=500, classifier__max_depth=2, total=  19.2s
[CV] classifier__n_estimators=600, classifier__max_depth=2 ...........
[CV] classifier__n_estimators=5, classifier__max_depth=5 .............
[CV]  classifier__n_estimators=500, classifier__max_depth=2, total=  20.5s
[CV] classifier__n_estimators=500, classifier__max_depth=2 ...........
[CV]  classifier__n_estimators=5, classifier__max_depth=5, total=   0.7s
[CV] classifier__n_estimators=5, classifier__max_depth=5 .............
[CV]  classifier__n_estimators=5, classifier__max_depth=5, total=   1.0s
[CV]  classifier__n_estimators=300, classifier__max_depth=3, total=  17.3s
[CV] classifier__n_estimators=300, classifier__max_depth=3 ...........
[CV] classifier__n_estimators=10, classifier__max_depth=5 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=5, total=   1.5s
[CV] classifier__n_estimators=10, classifier__max_depth=5 ............
[CV]  classifier__n_estimators=200, classifier__max_depth=4, total=  14.0s
[CV] classifier__n_estimators=200, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=3, total=  18.2s
[CV] classifier__n_estimators=400, classifier__max_depth=3 ...........
[CV]  classifier__n_estimators=10, classifier__max_depth=5, total=   1.0s
[CV] classifier__n_estimators=10, classifier__max_depth=5 ............
[CV]  classifier__n_estimators=100, classifier__max_depth=4, total=   8.8s
[CV] classifier__n_estimators=20, classifier__max_depth=5 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=5, total=   1.2s
[CV] classifier__n_estimators=20, classifier__max_depth=5 ............
[CV]  classifier__n_estimators=600, classifier__max_depth=2, total=  25.9s
[CV] classifier__n_estimators=600, classifier__max_depth=2 ...........
[CV]  classifier__n_estimators=200, classifier__max_depth=3, total=  11.6s
[CV] classifier__n_estimators=20, classifier__max_depth=5 ............
[CV]  classifier__n_estimators=20, classifier__max_depth=5, total=   2.7s
[CV] classifier__n_estimators=50, classifier__max_depth=5 ............
[CV]  classifier__n_estimators=400, classifier__max_depth=2, total=  16.9s
[CV] classifier__n_estimators=50, classifier__max_depth=5 ............
[CV]  classifier__n_estimators=20, classifier__max_depth=5, total=   2.6s
[CV] classifier__n_estimators=50, classifier__max_depth=5 ............
[CV]  classifier__n_estimators=300, classifier__max_depth=4, total=  19.0s
[CV] classifier__n_estimators=400, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=20, classifier__max_depth=5, total=   2.6s
[CV] classifier__n_estimators=100, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=3, total=  24.3s
[CV] classifier__n_estimators=400, classifier__max_depth=3 ...........
[CV]  classifier__n_estimators=200, classifier__max_depth=4, total=  14.9s
[CV] classifier__n_estimators=100, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=5, total=   4.4s
[CV] classifier__n_estimators=100, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=5, total=   4.0s
[CV] classifier__n_estimators=200, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=200, classifier__max_depth=4, total=   9.0s
[CV] classifier__n_estimators=200, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=2, total=  17.6s
[CV] classifier__n_estimators=200, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=4, total=  24.0s
[CV] classifier__n_estimators=300, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=5, total=   5.7s
[CV] classifier__n_estimators=300, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=3, total=  12.2s
[CV] classifier__n_estimators=300, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=500, classifier__max_depth=3, total=  28.3s
[CV] classifier__n_estimators=600, classifier__max_depth=3 ...........
[CV]  classifier__n_estimators=500, classifier__max_depth=3, total=  29.9s
[CV] classifier__n_estimators=500, classifier__max_depth=3 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=4, total=  27.2s
[CV] classifier__n_estimators=400, classifier__max_depth=4 ...........
[CV]  classifier__n_estimators=600, classifier__max_depth=3, total=  32.9s
[CV] classifier__n_estimators=600, classifier__max_depth=3 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=5, total=  10.9s
[CV] classifier__n_estimators=300, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=5, total=   8.9s
[CV] classifier__n_estimators=400, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=5, total=   9.6s
[CV] classifier__n_estimators=400, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=500, classifier__max_depth=2, total=  23.5s
[CV] classifier__n_estimators=400, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=200, classifier__max_depth=5, total=  13.7s
[CV] classifier__n_estimators=500, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=600, classifier__max_depth=2, total=  27.4s
[CV] classifier__n_estimators=500, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=3, total=  23.9s
[CV] classifier__n_estimators=500, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=3, total=  18.3s
[CV] classifier__n_estimators=600, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=200, classifier__max_depth=5, total=  16.2s
[CV] classifier__n_estimators=600, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=500, classifier__max_depth=4, total=  38.6s
[CV] classifier__n_estimators=600, classifier__max_depth=5 ...........
[CV]  classifier__n_estimators=600, classifier__max_depth=4, total=  35.7s
[CV] classifier__n_estimators=5, classifier__max_depth=6 .............
[CV]  classifier__n_estimators=5, classifier__max_depth=6, total=   0.8s
[CV] classifier__n_estimators=5, classifier__max_depth=6 .............
[CV]  classifier__n_estimators=500, classifier__max_depth=4, total=  38.8s
[CV] classifier__n_estimators=5, classifier__max_depth=6 .............
[CV]  classifier__n_estimators=500, classifier__max_depth=4, total=  39.8s
[CV] classifier__n_estimators=10, classifier__max_depth=6 ............
[CV]  classifier__n_estimators=5, classifier__max_depth=6, total=   1.0s
[CV] classifier__n_estimators=10, classifier__max_depth=6 ............
[CV]  classifier__n_estimators=5, classifier__max_depth=6, total=   0.7s
[CV] classifier__n_estimators=10, classifier__max_depth=6 ............
[CV]  classifier__n_estimators=600, classifier__max_depth=4, total=  38.3s
[CV] classifier__n_estimators=20, classifier__max_depth=6 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=6, total=   1.6s
[CV]  classifier__n_estimators=10, classifier__max_depth=6, total=   1.3s
[CV] classifier__n_estimators=20, classifier__max_depth=6 ............
[CV] classifier__n_estimators=20, classifier__max_depth=6 ............
[CV]  classifier__n_estimators=600, classifier__max_depth=2, total=  26.9s
[CV] classifier__n_estimators=50, classifier__max_depth=6 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=6, total=   1.3s
[CV] classifier__n_estimators=50, classifier__max_depth=6 ............
[CV]  classifier__n_estimators=200, classifier__max_depth=5, total=  20.8s
[CV] classifier__n_estimators=50, classifier__max_depth=6 ............
[CV]  classifier__n_estimators=600, classifier__max_depth=4, total=  38.5s
[CV] classifier__n_estimators=100, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=20, classifier__max_depth=6, total=   2.9s
[CV] classifier__n_estimators=100, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=20, classifier__max_depth=6, total=   2.6s
[CV] classifier__n_estimators=100, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=20, classifier__max_depth=6, total=   3.1s
[CV] classifier__n_estimators=200, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=4, total=  23.9s
[CV] classifier__n_estimators=200, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=5, total=  23.8s
[CV] classifier__n_estimators=200, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=5, total=  24.2s
[CV] classifier__n_estimators=300, classifier__max_depth=6 ...........
[Parallel(n_jobs=25)]: Done 139 tasks      | elapsed:  1.1min
[CV]  classifier__n_estimators=500, classifier__max_depth=3, total=  23.0s
[CV] classifier__n_estimators=300, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=6, total=   5.2s
[CV] classifier__n_estimators=300, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=6, total=   5.2s
[CV] classifier__n_estimators=400, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=4, total=  31.0s
[CV] classifier__n_estimators=400, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=6, total=   7.4s
[CV] classifier__n_estimators=400, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=600, classifier__max_depth=3, total=  27.9s
[CV] classifier__n_estimators=500, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=6, total=  12.1s
[CV] classifier__n_estimators=500, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=4, total=  29.3s
[CV] classifier__n_estimators=500, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=6, total=  12.2s
[CV] classifier__n_estimators=600, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=6, total=  12.7s
[CV] classifier__n_estimators=600, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=600, classifier__max_depth=3, total=  30.2s
[CV] classifier__n_estimators=600, classifier__max_depth=6 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=5, total=  29.1s
[CV] classifier__n_estimators=5, classifier__max_depth=7 .............
[CV]  classifier__n_estimators=5, classifier__max_depth=7, total=   1.1s
[CV] classifier__n_estimators=5, classifier__max_depth=7 .............
[CV]  classifier__n_estimators=5, classifier__max_depth=7, total=   0.9s
[CV] classifier__n_estimators=5, classifier__max_depth=7 .............
[CV]  classifier__n_estimators=5, classifier__max_depth=7, total=   1.0s
[CV] classifier__n_estimators=10, classifier__max_depth=7 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=7, total=   2.1s
[CV] classifier__n_estimators=10, classifier__max_depth=7 ............
[CV]  classifier__n_estimators=400, classifier__max_depth=5, total=  34.7s
[CV] classifier__n_estimators=10, classifier__max_depth=7 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=7, total=   2.0s
[CV] classifier__n_estimators=20, classifier__max_depth=7 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=7, total=   1.4s
[CV] classifier__n_estimators=20, classifier__max_depth=7 ............
[CV]  classifier__n_estimators=400, classifier__max_depth=5, total=  34.6s
[CV] classifier__n_estimators=20, classifier__max_depth=7 ............
[CV]  classifier__n_estimators=20, classifier__max_depth=7, total=   5.1s
[CV] classifier__n_estimators=50, classifier__max_depth=7 ............
[CV]  classifier__n_estimators=200, classifier__max_depth=6, total=  26.7s
[CV] classifier__n_estimators=50, classifier__max_depth=7 ............
[CV]  classifier__n_estimators=20, classifier__max_depth=7, total=   4.5s
[CV] classifier__n_estimators=50, classifier__max_depth=7 ............
[CV]  classifier__n_estimators=50, classifier__max_depth=7, total=   8.5s
[CV] classifier__n_estimators=100, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=500, classifier__max_depth=5, total=  43.9s
[CV] classifier__n_estimators=100, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=7, total=   8.7s
[CV] classifier__n_estimators=100, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=6, total=  35.8s
[CV] classifier__n_estimators=200, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=600, classifier__max_depth=5, total=  49.3s
[CV] classifier__n_estimators=200, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=7, total=  15.8s
[CV] classifier__n_estimators=200, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=6, total=  47.0s
[CV] classifier__n_estimators=300, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=7, total=  22.1s
[CV] classifier__n_estimators=300, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=20, classifier__max_depth=7, total=  40.7s
[CV] classifier__n_estimators=300, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=500, classifier__max_depth=5, total= 1.2min
[CV] classifier__n_estimators=400, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=7, total=  42.7s
[CV] classifier__n_estimators=400, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=500, classifier__max_depth=6, total= 1.1min
[CV] classifier__n_estimators=400, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=6, total= 1.3min
[CV] classifier__n_estimators=500, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=6, total= 1.3min
[CV] classifier__n_estimators=500, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=200, classifier__max_depth=6, total= 1.4min
[CV] classifier__n_estimators=500, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=6, total= 1.5min
[CV] classifier__n_estimators=600, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=600, classifier__max_depth=5, total= 1.7min
[CV] classifier__n_estimators=600, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=7, total=  59.5s
[CV] classifier__n_estimators=600, classifier__max_depth=7 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=6, total= 1.6min
[CV] classifier__n_estimators=5, classifier__max_depth=8 .............
[CV]  classifier__n_estimators=600, classifier__max_depth=6, total= 1.5min
[CV] classifier__n_estimators=5, classifier__max_depth=8 .............
[CV]  classifier__n_estimators=500, classifier__max_depth=5, total= 1.9min
[CV] classifier__n_estimators=5, classifier__max_depth=8 .............
[CV]  classifier__n_estimators=5, classifier__max_depth=8, total=   1.1s
[CV] classifier__n_estimators=10, classifier__max_depth=8 ............
[CV]  classifier__n_estimators=5, classifier__max_depth=8, total=   1.2s
[CV] classifier__n_estimators=10, classifier__max_depth=8 ............
[CV]  classifier__n_estimators=200, classifier__max_depth=6, total= 1.7min
[CV] classifier__n_estimators=10, classifier__max_depth=8 ............
[CV]  classifier__n_estimators=5, classifier__max_depth=8, total=   3.5s
[CV] classifier__n_estimators=20, classifier__max_depth=8 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=8, total=   3.0s
[CV] classifier__n_estimators=20, classifier__max_depth=8 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=8, total=   3.0s
[CV] classifier__n_estimators=20, classifier__max_depth=8 ............
[CV]  classifier__n_estimators=20, classifier__max_depth=8, total=   4.8s
[CV] classifier__n_estimators=50, classifier__max_depth=8 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=8, total=   7.6s
[CV] classifier__n_estimators=50, classifier__max_depth=8 ............
[CV]  classifier__n_estimators=200, classifier__max_depth=7, total= 1.2min
[CV] classifier__n_estimators=50, classifier__max_depth=8 ............
[CV]  classifier__n_estimators=20, classifier__max_depth=8, total=   5.0s
[CV] classifier__n_estimators=100, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=5, total= 2.2min
[CV] classifier__n_estimators=100, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=20, classifier__max_depth=8, total=  14.8s
[CV] classifier__n_estimators=100, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=500, classifier__max_depth=6, total= 1.8min
[CV] classifier__n_estimators=200, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=8, total=  10.8s
[CV] classifier__n_estimators=200, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=8, total=  10.6s
[CV] classifier__n_estimators=200, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=8, total=  14.5s
[CV] classifier__n_estimators=300, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=200, classifier__max_depth=7, total= 1.4min
[CV] classifier__n_estimators=300, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=8, total=  23.2s
[CV] classifier__n_estimators=300, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=500, classifier__max_depth=6, total= 2.3min
[CV] classifier__n_estimators=400, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=7, total= 1.6min
[CV] classifier__n_estimators=400, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=600, classifier__max_depth=5, total= 2.6min
[CV]  classifier__n_estimators=200, classifier__max_depth=7, total= 1.8min
[CV] classifier__n_estimators=400, classifier__max_depth=8 ...........
[CV] classifier__n_estimators=500, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=7, total= 1.5min
[CV] classifier__n_estimators=500, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=7, total= 1.6min
[CV] classifier__n_estimators=500, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=8, total=  45.0s
[CV] classifier__n_estimators=600, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=200, classifier__max_depth=8, total=  38.0s
[CV] classifier__n_estimators=600, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=500, classifier__max_depth=7, total= 1.4min
[CV] classifier__n_estimators=600, classifier__max_depth=8 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=7, total= 1.6min
[CV] classifier__n_estimators=5, classifier__max_depth=9 .............
[CV]  classifier__n_estimators=200, classifier__max_depth=8, total=  50.0s
[CV] classifier__n_estimators=5, classifier__max_depth=9 .............
[CV]  classifier__n_estimators=500, classifier__max_depth=7, total= 1.5min
[CV] classifier__n_estimators=5, classifier__max_depth=9 .............
[CV]  classifier__n_estimators=300, classifier__max_depth=7, total= 2.0min
[CV] classifier__n_estimators=10, classifier__max_depth=9 ............
[CV]  classifier__n_estimators=5, classifier__max_depth=9, total=   1.5s
[CV] classifier__n_estimators=10, classifier__max_depth=9 ............
[CV]  classifier__n_estimators=5, classifier__max_depth=9, total=   1.8s
[CV] classifier__n_estimators=10, classifier__max_depth=9 ............
[CV]  classifier__n_estimators=5, classifier__max_depth=9, total=   3.8s
[CV] classifier__n_estimators=20, classifier__max_depth=9 ............
[CV]  classifier__n_estimators=600, classifier__max_depth=6, total= 2.6min
[CV] classifier__n_estimators=20, classifier__max_depth=9 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=9, total=   4.1s
[CV] classifier__n_estimators=20, classifier__max_depth=9 ............
[CV]  classifier__n_estimators=400, classifier__max_depth=7, total= 1.9min
[CV] classifier__n_estimators=50, classifier__max_depth=9 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=9, total=   3.7s
[CV] classifier__n_estimators=50, classifier__max_depth=9 ............
[CV]  classifier__n_estimators=10, classifier__max_depth=9, total=   6.9s
[CV] classifier__n_estimators=50, classifier__max_depth=9 ............
[CV]  classifier__n_estimators=600, classifier__max_depth=7, total= 1.5min
[CV] classifier__n_estimators=100, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=20, classifier__max_depth=9, total=   8.0s
[CV] classifier__n_estimators=100, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=20, classifier__max_depth=9, total=   7.9s
[CV] classifier__n_estimators=100, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=8, total= 1.1min
[CV] classifier__n_estimators=200, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=8, total= 1.2min
[CV] classifier__n_estimators=200, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=20, classifier__max_depth=9, total=  16.6s
[CV] classifier__n_estimators=200, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=9, total=  15.3s
[CV] classifier__n_estimators=300, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=8, total= 1.0min
[CV] classifier__n_estimators=300, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=200, classifier__max_depth=8, total= 1.3min
[CV] classifier__n_estimators=300, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=9, total=  28.7s
[CV] classifier__n_estimators=400, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=50, classifier__max_depth=9, total=  35.6s
[CV] classifier__n_estimators=400, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=600, classifier__max_depth=7, total= 2.0min
[CV] classifier__n_estimators=400, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=300, classifier__max_depth=8, total= 1.4min
[CV]  classifier__n_estimators=100, classifier__max_depth=9, total=  31.3s
[CV] classifier__n_estimators=500, classifier__max_depth=9 ...........
[CV] classifier__n_estimators=500, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=500, classifier__max_depth=7, total= 2.4min
[CV] classifier__n_estimators=500, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=9, total=  49.3s
[CV] classifier__n_estimators=600, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=600, classifier__max_depth=7, total= 2.5min
[CV] classifier__n_estimators=600, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=600, classifier__max_depth=6, total= 3.8min
[CV] classifier__n_estimators=600, classifier__max_depth=9 ...........
[CV]  classifier__n_estimators=100, classifier__max_depth=9, total=  58.7s
[CV] classifier__n_estimators=5, classifier__max_depth=10 ............
[CV]  classifier__n_estimators=200, classifier__max_depth=9, total=  54.6s
[CV] classifier__n_estimators=5, classifier__max_depth=10 ............
[CV]  classifier__n_estimators=5, classifier__max_depth=10, total=   3.2s
[CV] classifier__n_estimators=5, classifier__max_depth=10 ............
[CV]  classifier__n_estimators=200, classifier__max_depth=9, total= 1.0min
[CV] classifier__n_estimators=10, classifier__max_depth=10 ...........
[CV]  classifier__n_estimators=400, classifier__max_depth=8, total= 1.8min
[CV] classifier__n_estimators=10, classifier__max_depth=10 ...........
[CV]  classifier__n_estimators=5, classifier__max_depth=10, total=   2.7s
[CV] classifier__n_estimators=10, classifier__max_depth=10 ...........
[CV]  classifier__n_estimators=500, classifier__max_depth=8, total= 1.6min
[CV] classifier__n_estimators=20, classifier__max_depth=10 ...........
[CV]  classifier__n_estimators=5, classifier__max_depth=10, total=  12.4s
[CV] classifier__n_estimators=20, classifier__max_depth=10 ...........
[CV]  classifier__n_estimators=10, classifier__max_depth=10, total=   6.1s
[CV] classifier__n_estimators=20, classifier__max_depth=10 ...........
[CV]  classifier__n_estimators=10, classifier__max_depth=10, total=   5.1s
[CV] classifier__n_estimators=50, classifier__max_depth=10 ...........
[CV]  classifier__n_estimators=20, classifier__max_depth=10, total=  10.9s
[CV]  classifier__n_estimators=200, classifier__max_depth=9, total= 1.2min
[CV] classifier__n_estimators=50, classifier__max_depth=10 ...........
[CV] classifier__n_estimators=50, classifier__max_depth=10 ...........
[CV]  classifier__n_estimators=600, classifier__max_depth=8, total= 1.8min
[CV] classifier__n_estimators=100, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=10, classifier__max_depth=10, total=  19.5s
[CV] classifier__n_estimators=100, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=500, classifier__max_depth=8, total= 2.1min
[CV] classifier__n_estimators=100, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=600, classifier__max_depth=8, total= 1.9min
[CV] classifier__n_estimators=200, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=20, classifier__max_depth=10, total=  17.1s
[CV] classifier__n_estimators=200, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=20, classifier__max_depth=10, total=  22.8s
[CV] classifier__n_estimators=200, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=500, classifier__max_depth=8, total= 2.0min
[CV] classifier__n_estimators=300, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=300, classifier__max_depth=9, total= 1.4min
[CV] classifier__n_estimators=300, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=50, classifier__max_depth=10, total=  23.4s
[CV] classifier__n_estimators=300, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=50, classifier__max_depth=10, total=  19.5s
[CV] classifier__n_estimators=400, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=300, classifier__max_depth=9, total= 1.5min
[CV] classifier__n_estimators=400, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=50, classifier__max_depth=10, total=  26.4s
[CV] classifier__n_estimators=400, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=400, classifier__max_depth=9, total= 1.5min
[CV] classifier__n_estimators=500, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=400, classifier__max_depth=8, total= 2.5min
[CV] classifier__n_estimators=500, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=400, classifier__max_depth=9, total= 1.5min
[CV] classifier__n_estimators=500, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=400, classifier__max_depth=8, total= 2.7min
[CV] classifier__n_estimators=600, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=100, classifier__max_depth=10, total=  41.5s
[CV] classifier__n_estimators=600, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=600, classifier__max_depth=8, total= 2.4min
[CV] classifier__n_estimators=600, classifier__max_depth=10 ..........
[CV]  classifier__n_estimators=100, classifier__max_depth=10, total=  48.4s
[CV]  classifier__n_estimators=400, classifier__max_depth=9, total= 1.8min
[CV]  classifier__n_estimators=100, classifier__max_depth=10, total=  56.6s
[CV]  classifier__n_estimators=300, classifier__max_depth=9, total= 2.2min
[CV]  classifier__n_estimators=200, classifier__max_depth=10, total= 1.1min
[CV]  classifier__n_estimators=200, classifier__max_depth=10, total= 1.3min
[CV]  classifier__n_estimators=200, classifier__max_depth=10, total= 1.5min
[CV]  classifier__n_estimators=500, classifier__max_depth=9, total= 2.5min
[CV]  classifier__n_estimators=300, classifier__max_depth=10, total= 1.6min
[CV]  classifier__n_estimators=300, classifier__max_depth=10, total= 1.8min
[CV]  classifier__n_estimators=300, classifier__max_depth=10, total= 1.8min
[CV]  classifier__n_estimators=600, classifier__max_depth=9, total= 2.5min
[CV]  classifier__n_estimators=500, classifier__max_depth=9, total= 2.8min
[CV]  classifier__n_estimators=600, classifier__max_depth=9, total= 2.5min
[CV]  classifier__n_estimators=500, classifier__max_depth=9, total= 3.0min
[CV]  classifier__n_estimators=400, classifier__max_depth=10, total= 1.8min
[CV]  classifier__n_estimators=400, classifier__max_depth=10, total= 1.9min
[CV]  classifier__n_estimators=600, classifier__max_depth=9, total= 2.9min
[CV]  classifier__n_estimators=400, classifier__max_depth=10, total= 2.1min
[CV]  classifier__n_estimators=500, classifier__max_depth=10, total= 2.0min
[CV]  classifier__n_estimators=500, classifier__max_depth=10, total= 2.0min
[CV]  classifier__n_estimators=600, classifier__max_depth=10, total= 2.2min
[CV]  classifier__n_estimators=500, classifier__max_depth=10, total= 2.4min
[CV]  classifier__n_estimators=600, classifier__max_depth=10, total= 2.4min
[CV]  classifier__n_estimators=600, classifier__max_depth=10, total= 2.5min
[Parallel(n_jobs=25)]: Done 300 out of 300 | elapsed:  8.8min finished
Out[5]:
GridSearchCV(cv=None, error_score='raise',
       estimator=Pipeline(steps=[('classifier', GradientBoostingClassifier(criterion='friedman_mse', init=None,
              learning_rate=0.1, loss='exponential', max_depth=3,
              max_features=None, max_leaf_nodes=None,
              min_impurity_split=1e-07, min_samples_leaf=1,
              min_samples_split=2, min_weight_fraction_leaf=0.0,
              n_estimators=100, presort='auto', random_state=2,
              subsample=1.0, verbose=0, warm_start=False))]),
       fit_params={}, iid=True, n_jobs=25,
       param_grid={'classifier__n_estimators': [5, 10, 20, 50, 100, 200, 300, 400, 500, 600], 'classifier__max_depth': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]},
       pre_dispatch='2*n_jobs', refit=True, return_train_score=True,
       scoring=None, verbose=2)

In [20]:
grid_search.best_params_


Out[20]:
{'classifier__max_depth': 5, 'classifier__n_estimators': 100}

In [6]:
cv_results = pd.DataFrame(grid_search.cv_results_)

In [7]:
cv_results


Out[7]:
mean_fit_time mean_score_time mean_test_score mean_train_score param_classifier__max_depth param_classifier__n_estimators params rank_test_score split0_test_score split0_train_score split1_test_score split1_train_score split2_test_score split2_train_score std_fit_time std_score_time std_test_score std_train_score
0 0.124350 0.003587 0.624893 0.625878 1 5 {u'classifier__n_estimators': 5, u'classifier_... 99 0.626134 0.627407 0.620045 0.626541 0.628500 0.623687 0.003914 0.000559 0.003561 0.001589
1 0.199901 0.005151 0.624873 0.626813 1 10 {u'classifier__n_estimators': 10, u'classifier... 100 0.624164 0.626302 0.621299 0.628959 0.629156 0.625179 0.040196 0.000582 0.003247 0.001585
2 0.515962 0.007888 0.631420 0.634225 1 20 {u'classifier__n_estimators': 20, u'classifier... 98 0.631507 0.633585 0.627806 0.635406 0.634947 0.633686 0.046533 0.000130 0.002916 0.000836
3 1.510248 0.014570 0.659337 0.662034 1 50 {u'classifier__n_estimators': 50, u'classifier... 96 0.659682 0.662568 0.655802 0.659822 0.662528 0.663712 0.137765 0.000598 0.002756 0.001632
4 2.579062 0.019430 0.712924 0.716048 1 100 {u'classifier__n_estimators': 100, u'classifie... 94 0.716452 0.721846 0.714721 0.717488 0.707600 0.708811 0.231105 0.003755 0.003831 0.005418
5 4.828316 0.045182 0.736922 0.742473 1 200 {u'classifier__n_estimators': 200, u'classifie... 89 0.734300 0.741665 0.735852 0.743277 0.740613 0.742479 0.522091 0.018151 0.002686 0.000658
6 7.708707 0.057503 0.744165 0.748692 1 300 {u'classifier__n_estimators': 300, u'classifie... 84 0.742180 0.747903 0.742359 0.748679 0.747955 0.749493 0.418122 0.000038 0.002681 0.000649
7 9.728296 0.072701 0.746572 0.752144 1 400 {u'classifier__n_estimators': 400, u'classifie... 79 0.746060 0.750828 0.743971 0.753336 0.749687 0.752268 0.195547 0.006477 0.002361 0.001027
8 12.004228 0.083074 0.748403 0.753408 1 500 {u'classifier__n_estimators': 500, u'classifie... 71 0.747970 0.752410 0.745463 0.755007 0.751776 0.752806 1.205721 0.011171 0.002595 0.001142
9 15.092670 0.097635 0.748682 0.753636 1 600 {u'classifier__n_estimators': 600, u'classifie... 68 0.748687 0.752679 0.745642 0.755097 0.751716 0.753134 1.912546 0.004584 0.002480 0.001049
10 0.269011 0.005947 0.648314 0.652134 2 5 {u'classifier__n_estimators': 5, u'classifier_... 97 0.652459 0.653076 0.638312 0.647614 0.654170 0.655713 0.023341 0.001035 0.007107 0.003373
11 0.430955 0.006842 0.661526 0.664352 2 10 {u'classifier__n_estimators': 10, u'classifier... 95 0.664160 0.666985 0.658429 0.663612 0.661990 0.662458 0.033832 0.001040 0.002362 0.001921
12 0.936188 0.011190 0.722376 0.726067 2 20 {u'classifier__n_estimators': 20, u'classifier... 91 0.720869 0.727368 0.716153 0.718682 0.730106 0.732151 0.128106 0.000296 0.005795 0.005575
13 2.092021 0.018744 0.745319 0.750244 2 50 {u'classifier__n_estimators': 50, u'classifier... 83 0.745045 0.750201 0.742120 0.750589 0.748791 0.749940 0.424441 0.005292 0.002730 0.000267
14 3.765199 0.029933 0.750811 0.756144 2 100 {u'classifier__n_estimators': 100, u'classifie... 56 0.749761 0.755843 0.749164 0.757604 0.753507 0.754984 0.358646 0.005573 0.001922 0.001090
15 8.361417 0.059305 0.752542 0.759725 2 200 {u'classifier__n_estimators': 200, u'classifie... 46 0.753462 0.759156 0.750179 0.761156 0.753985 0.758865 1.091169 0.003030 0.001684 0.001018
16 12.050471 0.074266 0.753119 0.761377 2 300 {u'classifier__n_estimators': 300, u'classifie... 40 0.754716 0.760141 0.750657 0.763663 0.753985 0.760327 0.610963 0.013129 0.001767 0.001618
17 16.599201 0.100075 0.753318 0.762601 2 400 {u'classifier__n_estimators': 400, u'classifie... 38 0.754895 0.761902 0.750955 0.764051 0.754104 0.761849 0.824339 0.007804 0.001702 0.001026
18 20.927085 0.132801 0.754512 0.763815 2 500 {u'classifier__n_estimators': 500, u'classifie... 19 0.755731 0.763633 0.752388 0.764887 0.755418 0.762924 1.831645 0.010141 0.001507 0.000812
19 26.569623 0.151930 0.754214 0.765138 2 600 {u'classifier__n_estimators': 600, u'classifie... 24 0.756566 0.764887 0.751970 0.765126 0.754104 0.765401 0.576737 0.009644 0.001878 0.000210
20 0.293598 0.006047 0.713422 0.718307 3 5 {u'classifier__n_estimators': 5, u'classifier_... 93 0.704453 0.712056 0.711318 0.717190 0.724494 0.725675 0.014422 0.001097 0.008316 0.005616
21 0.636483 0.014102 0.721520 0.725301 3 10 {u'classifier__n_estimators': 10, u'classifier... 92 0.724570 0.727577 0.716273 0.721488 0.723718 0.726839 0.041986 0.007846 0.003727 0.002713
22 1.260826 0.012650 0.743608 0.748552 3 20 {u'classifier__n_estimators': 20, u'classifier... 85 0.742240 0.748411 0.742299 0.748202 0.746284 0.749045 0.082956 0.002898 0.001892 0.000359
23 3.225238 0.025809 0.750572 0.758313 3 50 {u'classifier__n_estimators': 50, u'classifier... 60 0.750298 0.758290 0.750239 0.759335 0.751179 0.757313 0.174540 0.008014 0.000430 0.000826
24 5.498497 0.045763 0.753696 0.762163 3 100 {u'classifier__n_estimators': 100, u'classifie... 32 0.754298 0.760977 0.751970 0.763812 0.754821 0.761700 0.029007 0.000354 0.001239 0.001203
25 10.937695 0.075684 0.754631 0.766292 3 200 {u'classifier__n_estimators': 200, u'classifie... 17 0.756745 0.764349 0.751851 0.768021 0.755298 0.766505 0.708142 0.003200 0.002053 0.001506
26 15.777434 0.105495 0.754631 0.769884 3 300 {u'classifier__n_estimators': 300, u'classifie... 17 0.756268 0.768797 0.751791 0.771811 0.755835 0.769043 2.631624 0.006071 0.002016 0.001367
27 22.047911 0.133459 0.754353 0.772719 3 400 {u'classifier__n_estimators': 400, u'classifie... 22 0.755611 0.772319 0.751851 0.773901 0.755597 0.771938 2.758621 0.007156 0.001769 0.000850
28 26.871284 0.192877 0.754651 0.775296 3 500 {u'classifier__n_estimators': 500, u'classifie... 15 0.755432 0.774856 0.753343 0.775871 0.755179 0.775161 2.917275 0.074893 0.000931 0.000425
29 30.162273 0.179199 0.754870 0.778390 3 600 {u'classifier__n_estimators': 600, u'classifie... 12 0.756328 0.777781 0.752507 0.778826 0.755776 0.778564 2.035969 0.027476 0.001686 0.000444
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
70 1.909468 0.016826 0.747468 0.778738 8 5 {u'classifier__n_estimators': 5, u'classifier_... 76 0.747612 0.778915 0.745404 0.779423 0.749388 0.777877 1.087663 0.009151 0.001630 0.000643
71 4.502956 0.014476 0.751507 0.785584 8 10 {u'classifier__n_estimators': 10, u'classifier... 52 0.750000 0.787213 0.752686 0.784437 0.751836 0.785100 2.151204 0.001851 0.001121 0.001184
72 8.161859 0.048048 0.754054 0.793483 8 20 {u'classifier__n_estimators': 20, u'classifier... 27 0.753880 0.794406 0.754537 0.793511 0.753746 0.792532 4.653636 0.028919 0.000346 0.000765
73 11.941450 0.054067 0.755407 0.806935 8 50 {u'classifier__n_estimators': 50, u'classifier... 6 0.756387 0.808495 0.755134 0.806435 0.754701 0.805874 1.807463 0.001958 0.000715 0.001127
74 46.855635 0.128020 0.754910 0.822326 8 100 {u'classifier__n_estimators': 100, u'classifie... 11 0.756328 0.822762 0.754955 0.823359 0.753448 0.820857 20.292094 0.062670 0.001176 0.001067
75 55.133797 0.152512 0.753398 0.847140 8 200 {u'classifier__n_estimators': 200, u'classifie... 37 0.756208 0.847894 0.752985 0.847387 0.751000 0.846138 16.680031 0.022353 0.002146 0.000738
76 68.503322 0.248098 0.752821 0.871764 8 300 {u'classifier__n_estimators': 300, u'classifie... 44 0.755850 0.871474 0.752746 0.873743 0.749866 0.870075 8.729810 0.013165 0.002444 0.001511
77 140.476567 0.834749 0.752005 0.893573 8 400 {u'classifier__n_estimators': 400, u'classifie... 50 0.754835 0.892935 0.753044 0.896069 0.748134 0.891714 23.718944 0.709707 0.002833 0.001834
78 114.292887 0.382478 0.750413 0.913979 8 500 {u'classifier__n_estimators': 500, u'classifie... 61 0.751254 0.915023 0.753761 0.915530 0.746224 0.911384 11.450745 0.009491 0.003134 0.001847
79 122.391986 0.459652 0.747786 0.928913 8 600 {u'classifier__n_estimators': 600, u'classifie... 75 0.749821 0.929409 0.751194 0.929439 0.742344 0.927889 16.473637 0.051602 0.003889 0.000724
80 2.369117 0.010380 0.747388 0.794200 9 5 {u'classifier__n_estimators': 5, u'classifier_... 77 0.745941 0.796168 0.746597 0.793601 0.749627 0.792831 1.027374 0.001830 0.001605 0.001427
81 4.887409 0.019177 0.751050 0.804238 9 10 {u'classifier__n_estimators': 10, u'classifier... 54 0.751492 0.807002 0.752567 0.802883 0.749090 0.802830 1.429738 0.000362 0.001454 0.001955
82 10.788364 0.033367 0.754054 0.814416 9 20 {u'classifier__n_estimators': 20, u'classifier... 27 0.752806 0.817001 0.755611 0.813569 0.753746 0.812679 4.066792 0.000524 0.001166 0.001864
83 26.453939 0.095450 0.753975 0.831111 9 50 {u'classifier__n_estimators': 50, u'classifier... 29 0.755014 0.832970 0.755193 0.831508 0.751716 0.828856 8.403338 0.038773 0.001599 0.001703
84 46.333774 0.109222 0.753477 0.848851 9 100 {u'classifier__n_estimators': 100, u'classifie... 35 0.753701 0.849267 0.754955 0.848849 0.751776 0.848436 11.372983 0.009423 0.001307 0.000339
85 63.032850 0.190216 0.752025 0.880559 9 200 {u'classifier__n_estimators': 200, u'classifie... 49 0.754000 0.878518 0.753462 0.881085 0.748612 0.882074 7.547722 0.025919 0.002423 0.001498
86 100.539346 0.432756 0.750890 0.907711 9 300 {u'classifier__n_estimators': 300, u'classifie... 55 0.752806 0.906188 0.751970 0.908068 0.747896 0.908877 23.701010 0.259841 0.002145 0.001126
87 95.553143 0.318526 0.750114 0.931241 9 400 {u'classifier__n_estimators': 400, u'classifie... 63 0.752865 0.931469 0.750776 0.930544 0.746702 0.931710 9.425880 0.042967 0.002559 0.000503
88 163.953341 0.425673 0.748602 0.948174 9 500 {u'classifier__n_estimators': 500, u'classifie... 70 0.748926 0.948602 0.751194 0.947109 0.745687 0.948812 11.871646 0.017295 0.002260 0.000758
89 157.235956 0.469430 0.747866 0.962989 9 600 {u'classifier__n_estimators': 600, u'classifie... 73 0.748448 0.962899 0.751074 0.962660 0.744075 0.963407 9.564446 0.057301 0.002887 0.000312
90 6.099879 0.011410 0.743409 0.814894 10 5 {u'classifier__n_estimators': 5, u'classifier_... 86 0.739733 0.814852 0.746180 0.816136 0.744314 0.813694 4.461479 0.002716 0.002709 0.000997
91 10.227669 0.023562 0.747866 0.826724 10 10 {u'classifier__n_estimators': 10, u'classifier... 73 0.746299 0.828762 0.750179 0.825836 0.747120 0.825573 6.569716 0.001857 0.001670 0.001445
92 16.809419 0.144257 0.750791 0.840086 10 20 {u'classifier__n_estimators': 20, u'classifier... 57 0.749045 0.842223 0.752567 0.839208 0.750761 0.838825 4.851196 0.105029 0.001438 0.001520
93 23.020543 0.069602 0.753517 0.859526 10 50 {u'classifier__n_estimators': 50, u'classifier... 34 0.752030 0.859535 0.756805 0.859416 0.751716 0.859629 2.821898 0.010969 0.002329 0.000087
94 48.698386 0.163558 0.752443 0.879634 10 100 {u'classifier__n_estimators': 100, u'classifie... 47 0.751433 0.878817 0.754776 0.878906 0.751119 0.881178 6.103183 0.058687 0.001655 0.001093
95 79.078454 0.223173 0.751826 0.914138 10 200 {u'classifier__n_estimators': 200, u'classifie... 51 0.750418 0.912515 0.754716 0.913709 0.750343 0.916189 9.703191 0.011646 0.002044 0.001530
96 103.566639 0.267204 0.749955 0.943866 10 300 {u'classifier__n_estimators': 300, u'classifie... 65 0.748746 0.942722 0.751970 0.944065 0.749149 0.944813 5.281808 0.031177 0.001434 0.000865
97 116.578203 0.311290 0.748682 0.964014 10 400 {u'classifier__n_estimators': 400, u'classifie... 68 0.748806 0.962660 0.751074 0.963287 0.746164 0.966094 8.222602 0.034864 0.002006 0.001493
98 127.079094 0.455388 0.747209 0.977614 10 500 {u'classifier__n_estimators': 500, u'classifie... 78 0.746299 0.977644 0.749403 0.976539 0.745926 0.978659 10.908134 0.048461 0.001559 0.000866
99 140.428828 0.537423 0.745936 0.986648 10 600 {u'classifier__n_estimators': 600, u'classifie... 81 0.746180 0.986180 0.749463 0.986240 0.742165 0.987524 7.595946 0.030691 0.002984 0.000620

100 rows × 18 columns


In [8]:
pivot_test_score = cv_results.pivot("param_classifier__max_depth", "param_classifier__n_estimators", "mean_test_score")
pivot_test_score


Out[8]:
param_classifier__n_estimators 5 10 20 50 100 200 300 400 500 600
param_classifier__max_depth
1 0.624893 0.624873 0.631420 0.659337 0.712924 0.736922 0.744165 0.746572 0.748403 0.748682
2 0.648314 0.661526 0.722376 0.745319 0.750811 0.752542 0.753119 0.753318 0.754512 0.754214
3 0.713422 0.721520 0.743608 0.750572 0.753696 0.754631 0.754631 0.754353 0.754651 0.754870
4 0.729917 0.741061 0.749637 0.752781 0.754870 0.755746 0.755487 0.755049 0.753915 0.753975
5 0.738673 0.746373 0.750154 0.754651 0.755865 0.755208 0.754810 0.754393 0.753577 0.753219
6 0.745458 0.750095 0.753437 0.755228 0.755666 0.755547 0.754074 0.753000 0.752144 0.750672
7 0.748363 0.752841 0.754114 0.754412 0.755348 0.754333 0.752900 0.751249 0.750731 0.749557
8 0.747468 0.751507 0.754054 0.755407 0.754910 0.753398 0.752821 0.752005 0.750413 0.747786
9 0.747388 0.751050 0.754054 0.753975 0.753477 0.752025 0.750890 0.750114 0.748602 0.747866
10 0.743409 0.747866 0.750791 0.753517 0.752443 0.751826 0.749955 0.748682 0.747209 0.745936

In [9]:
# Draw a heatmap with the numeric values in each cell
fig, ax = plt.subplots()
sns.heatmap(pivot_test_score, annot=True, fmt='0.1%', ax=ax,
            cbar_kws={"label": "Testing set accuracy [\%]"}, robust=False, square=False)

# for _, spine in ax.spines.items():
#     spine.set_visible(True)
    
ax.set_xlabel('Number estimators')
ax.set_ylabel('Maximum depth')
ax.invert_yaxis()

outfile = os.path.join(comp.paths.figures_dir, 'model_evaluation',
                       'grid-search-max_depth-n_estimators-heatmap.png')
# plt.savefig(outfile)
plt.show()


/home/jbourbeau/.virtualenvs/composition/lib/python2.7/site-packages/matplotlib/figure.py:1743: UserWarning: This figure includes Axes that are not compatible with tight_layout, so its results might be incorrect.
  warnings.warn("This figure includes Axes that are not "

In [10]:
pivot_train_score = cv_results.pivot("param_classifier__max_depth", "param_classifier__n_estimators", "mean_train_score")
pivot_train_score


Out[10]:
param_classifier__n_estimators 5 10 20 50 100 200 300 400 500 600
param_classifier__max_depth
1 0.625878 0.626813 0.634225 0.662034 0.716048 0.742473 0.748692 0.752144 0.753408 0.753636
2 0.652134 0.664352 0.726067 0.750244 0.756144 0.759725 0.761377 0.762601 0.763815 0.765138
3 0.718307 0.725301 0.748552 0.758313 0.762163 0.766292 0.769884 0.772719 0.775296 0.778390
4 0.737210 0.748373 0.756999 0.762999 0.767446 0.774580 0.780470 0.785633 0.790727 0.795543
5 0.747826 0.756004 0.761228 0.769316 0.775316 0.785912 0.794946 0.803631 0.812257 0.821033
6 0.757556 0.764143 0.770481 0.778609 0.787305 0.801562 0.814765 0.827082 0.840593 0.852184
7 0.766620 0.773028 0.779435 0.790240 0.800786 0.821640 0.840742 0.858601 0.875734 0.890399
8 0.778738 0.785584 0.793483 0.806935 0.822326 0.847140 0.871764 0.893573 0.913979 0.928913
9 0.794200 0.804238 0.814416 0.831111 0.848851 0.880559 0.907711 0.931241 0.948174 0.962989
10 0.814894 0.826724 0.840086 0.859526 0.879634 0.914138 0.943866 0.964014 0.977614 0.986648

In [11]:
overfitting_pivot = (pivot_train_score - pivot_test_score)/pivot_test_score * 100
overfitting_pivot


Out[11]:
param_classifier__n_estimators 5 10 20 50 100 200 300 400 500 600
param_classifier__max_depth
1 0.157627 0.310482 0.444347 0.408931 0.438215 0.753362 0.608320 0.746288 0.668688 0.661795
2 0.589295 0.427135 0.510969 0.660776 0.710274 0.954548 1.096493 1.232237 1.232925 1.448434
3 0.684730 0.523991 0.664971 1.031284 1.123374 1.545195 2.021149 2.434715 2.735663 3.115774
4 0.999132 0.986790 0.982137 1.357353 1.665964 2.492101 3.306819 4.050600 4.882813 5.513182
5 1.239164 1.290356 1.476166 1.943308 2.573316 4.065555 5.317269 6.526957 7.786961 9.003252
6 1.622932 1.872879 2.262045 3.095854 4.186856 6.090335 8.048344 9.838276 11.759570 13.522864
7 2.439575 2.681450 3.357696 4.749029 6.015542 8.922683 11.667150 14.289877 16.650764 18.789986
8 4.183528 4.534383 5.228923 6.821117 8.930362 12.442556 15.799701 18.825415 21.796779 24.221662
9 6.263314 7.081922 8.005016 10.230665 12.657794 17.091787 20.884565 24.146483 26.659312 28.764899
10 9.615901 10.544382 11.893405 14.068607 16.903790 21.589072 25.856349 28.761459 30.835396 32.269852

In [12]:
# Draw a heatmap with the numeric values in each cell
fig, ax = plt.subplots()
sns.heatmap(overfitting_pivot, annot=True, ax=ax,
            cbar_kws={"label": "Overfitting [\%]"}, robust=True, square=False)

# for _, spine in ax.spines.items():
#     spine.set_visible(True)
    
ax.set_xlabel('Number estimators')
ax.set_ylabel('Maximum depth')
ax.invert_yaxis()

outfile = os.path.join(comp.paths.figures_dir, 'model_evaluation',
                       'grid-search-max_depth-n_estimators-heatmap-overfitting.png')
# plt.savefig(outfile)
plt.show()



In [13]:
pivot_test_std = cv_results.pivot("param_classifier__max_depth", "param_classifier__n_estimators", "std_test_score")
pivot_test_std


Out[13]:
param_classifier__n_estimators 5 10 20 50 100 200 300 400 500 600
param_classifier__max_depth
1 0.003561 0.003247 0.002916 0.002756 0.003831 0.002686 0.002681 0.002361 0.002595 0.002480
2 0.007107 0.002362 0.005795 0.002730 0.001922 0.001684 0.001767 0.001702 0.001507 0.001878
3 0.008316 0.003727 0.001892 0.000430 0.001239 0.002053 0.002016 0.001769 0.000931 0.001686
4 0.004255 0.002422 0.001742 0.000617 0.000561 0.000834 0.001202 0.000935 0.001029 0.000985
5 0.001709 0.003150 0.002410 0.001267 0.001345 0.001087 0.000697 0.000441 0.000718 0.001189
6 0.002992 0.001697 0.001193 0.000525 0.000975 0.001170 0.000786 0.001299 0.001325 0.001517
7 0.002151 0.001317 0.000868 0.001170 0.001669 0.001299 0.001845 0.001498 0.002226 0.001724
8 0.001630 0.001121 0.000346 0.000715 0.001176 0.002146 0.002444 0.002833 0.003134 0.003889
9 0.001605 0.001454 0.001166 0.001599 0.001307 0.002423 0.002145 0.002559 0.002260 0.002887
10 0.002709 0.001670 0.001438 0.002329 0.001655 0.002044 0.001434 0.002006 0.001559 0.002984

In [19]:
# Draw a heatmap with the numeric values in each cell
fig, ax = plt.subplots()
sns.heatmap(pivot_test_std*100, annot=True, fmt='0.2f', linewidths=.5, ax=ax,
            cbar_kws={"label": "Std"}, robust=True, square=False)
ax.set_xlabel('Number estimators')
ax.set_ylabel('Maximum depth')
plt.show()



In [15]:
pivot_test_rank = cv_results.pivot("param_classifier__max_depth", "param_classifier__n_estimators", "rank_test_score")
pivot_test_rank


Out[15]:
param_classifier__n_estimators 5 10 20 50 100 200 300 400 500 600
param_classifier__max_depth
1 99 100 98 96 94 89 84 79 71 68
2 97 95 91 83 56 46 40 38 19 24
3 93 92 85 60 32 17 17 22 15 12
4 90 87 66 45 12 2 5 10 31 29
5 88 80 62 15 1 9 14 21 33 39
6 82 64 36 8 3 4 26 41 48 59
7 72 43 25 20 7 23 42 53 58 67
8 76 52 27 6 11 37 44 50 61 75
9 77 54 27 29 35 49 55 63 70 73
10 86 73 57 34 47 51 65 68 78 81

In [16]:
# Draw a heatmap with the numeric values in each cell
fig, ax = plt.subplots()
sns.heatmap(pivot_test_rank, annot=True, fmt='d', linewidths=.5, ax=ax,
            cbar_kws={"label": "Test score rank"}, robust=True, square=False)
ax.set_xlabel('Number estimators')
ax.set_ylabel('Maximum depth')
ax.invert_yaxis()

outfile = os.path.join(comp.paths.figures_dir, 'model_evaluation',
                       'grid-search-max_depth-n_estimators-heatmap-test-rank.png')
# plt.savefig(outfile)
plt.show()



In [16]:
pivot_fit_time = cv_results.pivot("param_classifier__max_depth", "param_classifier__n_estimators", "mean_fit_time")
pivot_fit_time


Out[16]:
param_classifier__n_estimators 5 10 20 50 100 200 300 400 500 600
param_classifier__max_depth
1 0.118298 0.209823 0.424922 1.067445 2.326791 3.973685 5.449798 6.460932 8.501271 11.071048
2 0.226728 0.394157 0.777675 1.811893 3.038147 6.127894 8.540042 11.151531 13.852913 16.218600
3 0.209464 0.420541 0.861163 2.001204 3.800102 8.846494 12.297432 14.067836 19.236447 24.484771
4 0.336374 0.604984 1.235185 3.104119 5.119169 9.678869 15.730774 18.360161 23.640411 27.256437
5 0.404802 0.706598 1.183219 3.298988 6.213872 11.399018 17.786696 24.940043 54.227860 59.289663
6 0.491018 1.063702 1.855955 4.426094 8.132892 16.700048 20.557351 67.781456 83.113592 91.269366
7 0.698670 1.219647 2.862616 11.854092 34.097424 12.419558 19.483242 24.667472 71.512716 36.189908
8 4.632594 1.209142 2.245910 4.815686 32.550906 51.969422 22.415552 31.409309 46.906632 71.876275
9 0.840302 1.667498 3.427363 8.029299 15.329603 32.917098 50.195497 85.439795 96.674725 113.502156
10 2.485992 5.046360 11.946008 19.333625 35.845129 98.449756 104.557402 136.698006 160.922844 191.006499
11 4.815252 22.271014 20.515157 47.504083 85.621035 72.296619 136.622310 139.268169 193.004344 228.055230
12 12.154978 31.955266 31.745574 84.945010 59.340447 115.329009 117.266832 169.903285 179.132893 198.152193

In [19]:
# Draw a heatmap with the numeric values in each cell
fig, ax = plt.subplots()
sns.heatmap(pivot_fit_time, annot=True, linewidths=.5, ax=ax,
            cbar_kws={"label": "Mean fit time [s]"}, robust=True, square=False)
ax.set_xlabel('Number estimators')
ax.set_ylabel('Maximum depth')
plt.show()



In [ ]: