title: sklearn RandomizedSearchCV extract confusion matrix for different folds
body: <p>I try to calculate an aggregated confusion matrix to evaluate my model:</p>
  
  <pre><code>cv_results = cross_validate(estimator, dataset.data, dataset.target, scoring=scoring,
                  cv=Config.CROSS_VALIDATION_FOLDS, n_jobs=N_CPUS, return_train_score=False)
  </code></pre>
  
  <p>But I don't know how to extract the single confusion matrices of the different folds. In a scorer I can compute it:</p>
  
  <pre><code>scoring = {
  'cm': make_scorer(confusion_matrix)
  }
  </code></pre>
  
  <p>, but I cannot return the comfusion matrix, because it has to return a number instead of an array. If I try it I get the following error: </p>
  
  <pre><code>ValueError: scoring must return a number, got [[...]] (&lt;class 'numpy.ndarray'&gt;) instead. (scorer=cm)
  </code></pre>
  
  <p>I wonder if it is possible to store the confusion matrices in a global variable, but had no success using</p>
  
  <pre><code>global cm_list
  cm_list.append(confusion_matrix(y_true,y_pred))
  </code></pre>
  
  <p>in a custom scorer.</p>
  
  <p>Thanks in advance for any advice.</p>