code: def test_multilabel_confusion_matrix_multiclass(setup):
      # Test multilabel confusion matrix - multi-class case
      y_true, y_pred, _ = make_prediction(binary=False)
      y_true = mt.tensor(y_true, chunk_size=40)
      y_pred = mt.tensor(y_pred, chunk_size=40)
  
      def run_test(y_true, y_pred, string_type=False):
          # compute confusion matrix with default labels introspection
          cm = multilabel_confusion_matrix(y_true, y_pred).fetch()
          assert_array_equal(
              cm,
              [
                  [[47, 4], [5, 19]],
                  [[38, 6], [28, 3]],
                  [[30, 25], [2, 18]],
              ],
          )
  
          # compute confusion matrix with explicit label ordering
          labels = ["0", "2", "1"] if string_type else [0, 2, 1]
          cm = multilabel_confusion_matrix(
              y_true, y_pred, labels=labels
          ).fetch()
          assert_array_equal(
              cm,
              [
                  [[47, 4], [5, 19]],
                  [[30, 25], [2, 18]],
                  [[38, 6], [28, 3]],
              ],
          )
  
          # compute confusion matrix with super set of present labels
          labels = ["0", "2", "1", "3"] if string_type else [0, 2, 1, 3]
          cm = multilabel_confusion_matrix(
              y_true, y_pred, labels=labels
          ).fetch()
          assert_array_equal(
              cm,
              [
                  [[47, 4], [5, 19]],
                  [[30, 25], [2, 18]],
                  [[38, 6], [28, 3]],
                  [[75, 0], [0, 0]],
              ],
          )
  
      run_test(y_true, y_pred)
      run_test(y_true.astype(str), y_pred.astype(str), string_type=True)
  
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 7 for calling a global function with example usage: test_multilabel_confusion_matrix_multiclass(setup) without return types