@@ -590,11 +590,14 @@ def _fit(self, X, y, labels, parameter_iterable):
590
590
591
591
time = np .array (time , dtype = np .float64 ).reshape (n_candidates , n_splits )
592
592
time_means = np .average (time , axis = 1 )
593
- time_stds = np .sqrt (
594
- np .average ((time - time_means [:, np .newaxis ]) ** 2 ,
595
- axis = 1 ))
593
+ time_stds = np .sqrt (np .average ((time - time_means [:, np .newaxis ]) ** 2 ,
594
+ axis = 1 ))
596
595
597
596
cv_results = dict ()
597
+
598
+ cv_results ["mean_time" ] = time_means
599
+ cv_results ["std_time" ] = time_stds
600
+
598
601
for split_i in range (n_splits ):
599
602
cv_results ["split%d_test_score" % split_i ] = test_scores [:,
600
603
split_i ]
@@ -615,13 +618,12 @@ def _fit(self, X, y, labels, parameter_iterable):
615
618
method = 'min' ),
616
619
dtype = np .int32 )
617
620
618
- cv_results ["mean_test_time " ] = time_means
619
- cv_results [ "std_test_time" ] = time_stds
620
- ranks = np . asarray ( rankdata ( - test_means , method = 'min' ), dtype = np .int32 )
621
+ cv_results ["rank_test_score " ] = np . asarray ( rankdata ( - test_means ,
622
+ method = 'min' ),
623
+ dtype = np .int32 )
621
624
622
- best_index = np .flatnonzero (ranks == 1 )[0 ]
625
+ best_index = np .flatnonzero (cv_results [ "rank_test_score" ] == 1 )[0 ]
623
626
best_parameters = candidate_params [best_index ]
624
- cv_results ["rank_test_score" ] = ranks
625
627
626
628
# Use one np.MaskedArray and mask all the places where the param is not
627
629
# applicable for that candidate. Use defaultdict as each candidate may
0 commit comments