code: def test_precision_recall_f1_score_binary_averaged(setup):
      y_true = mt.array(
          [0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1], chunk_size=10
      )
      y_pred = mt.array(
          [1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1], chunk_size=10
      )
  
      # compute scores with default labels introspection
      ps, rs, fs, _ = precision_recall_fscore_support(
          y_true, y_pred, average=None
      )
      ps, rs, fs = fetch(execute(ps, rs, fs))
      p, r, f, _ = precision_recall_fscore_support(
          y_true, y_pred, average="macro"
      )
      p, r, f = fetch(execute(p, r, f))
      assert p == np.mean(ps)
      assert r == np.mean(rs)
      assert f == np.mean(fs)
      p, r, f, _ = precision_recall_fscore_support(
          y_true, y_pred, average="weighted"
      )
      p, r, f = fetch(execute(p, r, f))
      support = np.bincount(y_true).execute().fetch()
      assert p == np.average(ps, weights=support)
      assert r == np.average(rs, weights=support)
      assert f == np.average(fs, weights=support)
  
imports: import numpy
  import pytest
  from sklearn import datasets, svm
  from sklearn.exceptions import UndefinedMetricWarning
  from sklearn.metrics import accuracy_score
  from sklearn.utils import check_random_state
  from sklearn.utils._testing import assert_almost_equal, assert_array_equal, assert_array_almost_equal
  from sklearn.utils._mocking import MockDataFrame
  from ....None import execute, fetch
  from ....None import tensor
  from ....lib.sparse import SparseNDArray
  from ..None import accuracy_score, log_loss
  from .._classification import _check_targets, multilabel_confusion_matrix, precision_recall_fscore_support, precision_score, recall_score, f1_score, fbeta_score
label_desc: Use image node_id 13 for calling a global function with example usage: test_precision_recall_f1_score_binary_averaged(setup) without return types