docstr: Evaluate predicted target values for X relative to y_true.
  
  Parameters
  ----------
  y_true : array-like
      Gold standard target values for X.
  
  y_pred : array-like, [n_samples x n_classes]
      Model predictions
  
  X_data : array-like [n_samples x n_features]
      X data used to obtain the predictions: each row x_j corresponds to the input
       used to obtain predictions y_j
  
  sample_weight : array-like, optional (default=None)
      Sample weights.
  
  Returns
  -------
  score : float
      Score function applied to prediction of estimator on X.
docstr_tok: ["Evaluate","predicted","target","values","for","X","relative","to","y_true",".","Parameters","--","--","--","--","--","y_true",":","array-like","Gold","standard","target","values","for","X.","y_pred",":","array-like",",","[","n_samples","x","n_classes","]","Model","predictions","X_data",":","array-like","[","n_samples","x","n_features","]","X","data","used","to","obtain","the","predictions",":","each","row","x_j","corresponds","to","the","input","used","to","obtain","predictions","y_j","sample_weight",":","array-like",",","optional","(","default=None",")","Sample","weights",".","Returns","--","--","--","-","score",":","float","Score","function","applied","to","prediction","of","estimator","on","X","."]
code: def __call__(
      self,
      y_true: np.ndarray,
      y_pred: np.ndarray,
      *,
      X_data: Optional[SUPPORTED_XDATA_TYPES] = None,
      sample_weight: Optional[List[float]] = None,
  ) -> float:
      """Evaluate predicted target values for X relative to y_true.
  
      Parameters
      ----------
      y_true : array-like
          Gold standard target values for X.
  
      y_pred : array-like, [n_samples x n_classes]
          Model predictions
  
      X_data : array-like [n_samples x n_features]
          X data used to obtain the predictions: each row x_j corresponds to the input
           used to obtain predictions y_j
  
      sample_weight : array-like, optional (default=None)
          Sample weights.
  
      Returns
      -------
      score : float
          Score function applied to prediction of estimator on X.
      """
      type_true = type_of_target(y_true)
      if (
          type_true == "binary"
          and type_of_target(y_pred) == "continuous"
          and len(y_pred.shape) == 1
      ):
          # For a pred scorer, no threshold, nor probability is required
          # If y_true is binary, and y_pred is continuous
          # it means that a rounding is necessary to obtain the binary class
          y_pred = np.around(y_pred, decimals=0)
      elif (
          len(y_pred.shape) == 1
          or y_pred.shape[1] == 1
          or type_true == "continuous"
      ):
          # must be regression, all other task types would return at least
          # two probabilities
          pass
      elif type_true in ["binary", "multiclass"]:
          y_pred = np.argmax(y_pred, axis=1)
      elif type_true == "multilabel-indicator":
          y_pred[y_pred > 0.5] = 1.0
          y_pred[y_pred <= 0.5] = 0.0
      elif type_true == "continuous-multioutput":
          pass
      else:
          raise ValueError(type_true)
  
      scorer_kwargs = (
          {}
      )  # type: Dict[str, Union[List[float], np.ndarray]]
      if sample_weight is not None:
          scorer_kwargs["sample_weight"] = sample_weight
      if self._needs_X is True:
          scorer_kwargs["X_data"] = X_data
  
      return self._sign * self._score_func(
          y_true, y_pred, **scorer_kwargs, **self._kwargs
      )
  
imports: from abc import ABCMeta, abstractmethod
  from typing import Any, Callable, Dict, List, Optional, Sequence, Union
  import collections
  from functools import partial
  from itertools import product
  import numpy
  import sklearn.metrics
  from sklearn.utils.multiclass import type_of_target
  from smac.utils.constants import MAXINT
  from autosklearn.constants import BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, MULTILABEL_CLASSIFICATION, MULTIOUTPUT_REGRESSION, REGRESSION, REGRESSION_TASKS, TASK_TYPES
  from autosklearn.data.target_validator import SUPPORTED_XDATA_TYPES
  from .util import sanitize_array
label_desc: Use image node_id 1 for calling the _PredictScorer obj's underlying member method code with example usage: obj.__call__(y_true, y_pred) and returns: unknown