parameters: (raw_results, eval_train_metric=False)
return_statement: return [('cv_agg', k, np.mean(v), metric_type[k], np.std(v)) for k, v in cvmap.items()]
docstring: Aggregate cross-validation results.
docstring_summary: Aggregate cross-validation results.
docstring_tokens: Aggregate cross - validation results .
function: def _agg_cv_result(raw_results, eval_train_metric=False):
      """Aggregate cross-validation results."""
      cvmap = collections.OrderedDict()
      metric_type = {}
      for one_result in raw_results:
          for one_line in one_result:
              if eval_train_metric:
                  key = f"{one_line[0]} {one_line[1]}"
              else:
                  key = one_line[1]
              metric_type[key] = one_line[3]
              cvmap.setdefault(key, [])
              cvmap[key].append(one_line[2])
      return [('cv_agg', k, np.mean(v), metric_type[k], np.std(v)) for k, v in cvmap.items()]
function_tokens: def _agg_cv_result ( raw_results , eval_train_metric = False ) : cvmap = collections . OrderedDict ( ) metric_type = { } for one_result in raw_results : for one_line in one_result : if eval_train_metric : key = f"{one_line[0]} {one_line[1]}" else : key = one_line [ 1 ] metric_type [ key ] = one_line [ 3 ] cvmap . setdefault ( key , [ ] ) cvmap [ key ] . append ( one_line [ 2 ] ) return [ ( 'cv_agg' , k , np . mean ( v ) , metric_type [ k ] , np . std ( v ) ) for k , v in cvmap . items ( ) ]