code: def _daal_type_of_target(y):
      valid = (
          isinstance(y, Sequence)
          or sp.isspmatrix(y)
          or hasattr(y, "__array__")
      ) and not isinstance(y, str)
  
      if not valid:
          raise ValueError(
              "Expected array-like (array or non-string sequence), "
              "got %r" % y
          )
  
      sparse_pandas = y.__class__.__name__ in [
          "SparseSeries",
          "SparseArray",
      ]
      if sparse_pandas:
          raise ValueError(
              "y cannot be class 'SparseSeries' or 'SparseArray'"
          )
  
      if is_multilabel(y):
          return "multilabel-indicator"
  
      try:
          y = np.asarray(y)
      except ValueError:
          # Known to fail in numpy 1.3 for array of arrays
          return "unknown"
  
      # The old sequence of sequences format
      try:
          if (
              not hasattr(y[0], "__array__")
              and isinstance(y[0], Sequence)
              and not isinstance(y[0], str)
          ):
              raise ValueError(
                  "You appear to be using a legacy multi-label data"
                  " representation. Sequence of sequences are no"
                  " longer supported; use a binary array or sparse"
                  " matrix instead - the MultiLabelBinarizer"
                  " transformer can convert to this format."
              )
      except IndexError:
          pass
  
      # Invalid inputs
      if y.ndim > 2 or (
          y.dtype == object
          and len(y) != 0
          and not isinstance(y.flat[0], str)
      ):
          return "unknown"  # [[[1, 2]]] or [obj_1] and not ["label_1"]
  
      if y.ndim == 2 and y.shape[1] == 0:
          return "unknown"  # [[]]
  
      if y.ndim == 2 and y.shape[1] > 1:
          suffix = "-multioutput"  # [[1, 2], [1, 2]]
      else:
          suffix = ""  # [1, 2, 3] or [[1], [2], [3]]
  
      # check float and contains non-integer float values
      if y.dtype.kind == "f" and np.any(y != y.astype(int)):
          # [.1, .2, 3] or [[.1, .2, 3]] or [[1., .2]] and not [1., 2., 3.]
          _assert_all_finite(y)
          return "continuous" + suffix
  
      unique = (
          np.sort(pd.unique(y.ravel()))
          if pandas_is_imported
          else np.unique(y)
      )
  
      if (len(unique) > 2) or (y.ndim >= 2 and len(y[0]) > 1):
          # [1, 2, 3] or [[1., 2., 3]] or [[1, 2]]
          result = ("multiclass" + suffix, None)
      else:
          result = ("binary", unique)  # [1, 2] or [["a"], ["b"]]
      return result
  
file_path: scikit-learn-intelex/daal4py/sklearn/metrics/_ranking.py
imports: import logging
  from collections.abc import Sequence
  from functools import partial
  import numpy
  from scipy import sparse
  from sklearn.preprocessing import label_binarize
  from sklearn.utils import check_array
  from sklearn.utils.multiclass import is_multilabel
  import daal4py
  from .._device_offload import support_usm_ndarray
  from .._utils import PatchingConditionsChain, get_patch_message, sklearn_check_version
  from ..utils.validation import _assert_all_finite
label_desc: Use image node_id 1 for calling a global function with example usage: _daal_type_of_target(y) and returns: result, str, str, str, unknown, str