class_docstr: Encapsulate scorer function with extra methods.
  
  Scorer functions are functions used to compute various performance metrics, using the model and data as inputs,
  rather than the labels and predictions. Scorers are callables with the signature scorer(model, features, y_true).
  Additional data on scorer functions can be found at https://scikit-learn.org/stable/modules/model_evaluation.html.
  
  Parameters
  ----------
  scorer : t.Union[str, t.Callable]
      sklearn scorer name or callable
  model_classes: t.Optional[t.List]
      possible classes output for model. None for regression tasks.
  name : str, default = None
      scorer name
code: def _run_score(self, model, data: pd.DataFrame, label_col: pd.Series):
      # If scorer 'needs_threshold' or 'needs_proba' than the model has to have a predict_proba method.
      if ("needs" in self.scorer._factory_args()) and not hasattr(
          model, "predict_proba"  # pylint: disable=protected-access
      ):
          raise errors.DeepchecksValueError(
              f"Can't compute scorer {self.scorer} when predicted probabilities are "
              f"not provided. Please use a model with predict_proba method or "
              f"manually provide predicted probabilities to the check. "
              f"{SUPPORTED_MODELS_DOCLINK}"
          )
  
      label_col = pd.Series(label_col)
      original_label_col = label_col
      if self.model_classes is not None:
          model = self._wrap_classification_model(model, data)
          if model.is_binary:
              if len(label_col.unique()) > 2:
                  raise errors.DeepchecksValueError(
                      "Model is binary but the label column has more than 2 classes: "
                      f"{label_col.unique()}"
                  )
  
              label_col = label_col.map(
                  {self.model_classes[0]: 0, self.model_classes[1]: 1}
              )
          else:
              # if multilabel convert from series of lists to 2d numpy array
              if (len(label_col) != 0) and is_sequence_not_str(
                  next(iter(label_col))
              ):
                  label_col = np.array([np.array(x) for x in label_col])
              label_col = _transform_to_multi_label_format(
                  np.array(label_col), self.model_classes
              )
  
      try:
          scores = self.scorer(model, data, np.array(label_col))
      except ValueError as e:
          if (
              getattr(self.scorer, "_score_func", "").__name__
              == "roc_auc_score"
          ):
              get_logger().warning(
                  'ROC AUC failed with error message - "%s". setting scores as None',
                  e,
                  exc_info=get_logger().level == logging.DEBUG,
              )
              scores = None
          else:
              raise
  
      # The scores returned are for the model classes, but we want scores of the observed classes
      if self.model_classes is not None and isinstance(
          scores, np.ndarray
      ):
          # In case of single label on binary model, there is problem with scorers per class, since scikit-learn
          # scorers will return score only for the seen label (and not for the unseen label)
          if (
              model.is_binary
              and len(original_label_col.unique()) == 1
              and len(model.predictions.unique()) == 1
              and original_label_col[0] == model.predictions[0]
          ):
              seen_class = original_label_col[0]
              unseen_class = (
                  self.model_classes[0]
                  if seen_class == self.model_classes[1]
                  else self.model_classes[1]
              )
              return {seen_class: scores[0], unseen_class: 0}
  
          scores = self.validate_scorer_multilabel_output(scores)
  
      return scores
  
imports: import logging
  import typing
  import warnings
  from numbers import Number
  from typing import TYPE_CHECKING
  import numpy
  import pandas
  from packaging import version
  from sklearn import __version__
  from sklearn.base import ClassifierMixin
  from sklearn.metrics import get_scorer, log_loss, make_scorer, mean_absolute_error, mean_squared_error
  from sklearn.metrics._scorer import _BaseScorer, _ProbaScorer
  from sklearn.preprocessing import OneHotEncoder
  from deepchecks.core import errors
  from deepchecks.tabular.metric_utils.additional_classification_metrics import false_negative_rate_metric, false_positive_rate_metric, roc_auc_per_class, true_negative_rate_metric
  from deepchecks.tabular.utils.task_type import TaskType
  from deepchecks.utils.docref import doclink
  from deepchecks.utils.logger import get_logger
  from deepchecks.utils.metrics import get_scorer_name
  from deepchecks.utils.simple_models import PerfectModel
  from deepchecks.utils.typing import BasicModel
  from deepchecks.utils.validation import is_sequence_not_str
label_desc: Use image node_id 6 for calling the DeepcheckScorer obj's underlying member method code with example usage: obj._run_score(model, data, label_col) and returns: scores, dict