class_docstr: Wrapper to replace call kwargs with preset values if target is binary.
class_docstr_tok: ["Wrapper","to","replace","call","kwargs","with","preset","values","if","target","is","binary","."]
code: def __call__(self, y_true, y_pred, **kwargs):
      if self.kwargs_if_binary:
          labels = kwargs.get("labels", None)
          is_binary = (
              len(labels) <= 2
              if labels is not None
              else ((y_true == 0) | (y_true == 1)).all()
          )
          if is_binary:
              kwargs = {**kwargs, **self.kwargs_if_binary}
      return self.score_func(y_true, y_pred, **kwargs)
  
imports: import traceback
  import warnings
  from typing import Callable
  import numpy
  from sklearn.exceptions import FitFailedWarning
  from sklearn.metrics._scorer import _PredictScorer, _ProbaScorer, _ThresholdScorer
  from sklearn.preprocessing import LabelEncoder
  from sklearn.utils import _safe_indexing
  from pycaret.utils.generic import get_label_encoder
label_desc: Use image node_id 2 for calling the BinaryMulticlassScoreFunc obj's underlying member method code with example usage: obj.__call__(y_true, y_pred) and returns: self