title: Why do I get a ValueError, when passing 2D arrays to sklearn.metrics.recall_score?
body: <p>I want to use <code>sklearn.metrics.recall_score</code> to evaluate recall for a binary image segmentation task.
  Doing this works:</p>
  <pre><code>threshold = 0.5
  predicted_mask = (probability_map &gt; threshold).astype(np.int)
  actual_mask = actual_mask.astype(np.int)
  result = recall_score(actual_mask.flatten(), predicted_mask.flatten())
  </code></pre>
  <p>This however:</p>
  <pre><code>result = recall_score(actual_mask, predicted_mask)
  </code></pre>
  <p>gives me the error:</p>
  <blockquote>
  <p>ValueError: Target is multilabel-indicator but average='binary'. Please choose another average setting, one of [None, 'micro', 'macro', 'weighted', 'samples'].</p>
  </blockquote>
  <p><code>actual_mask</code> and <code>predicted_mask</code> are numpy-arrays with integers of 0 and 1.</p>
  <p>It is not obvious to me from the <a href="https://scikit-learn.org/stable/modules/generated/sklearn.metrics.recall_score.html" rel="nofollow noreferrer">documentation</a> that this should not work:</p>
  <blockquote>
  <p>sklearn.metrics.precision_score(y_true, y_pred, *, labels=None, pos_label=1, average='binary', sample_weight=None, zero_division='warn')</p>
  <p>y_true: 1d array-like, or label indicator array / sparse matrix</p>
  <p>y_pred: 1d array-like, or label indicator array / sparse matrix</p>
  </blockquote>
  <p>What am I missing? And more importantly: Is the recall-value that I obtain using the <code>flatten</code> operation  correct?</p>