code: def make_one_vs_all_scorer(
      metric, pos_label=1, greater_is_better=True
  ):
      """
      Returns a binary one vs all scorer for a single class('pos_label') of a
      multiclass classifier metric.
  
      Args:
          metric (function): classification metric of the form metric(y_true, y_pred)
          pos_label (int): index of the positive label. Defaults to 1.
          greater_is_better (bool): does a higher metric correspond to a better model.
              Defaults to True.
  
      Returns:
          a binary sklearn-compatible scorer function.
      """
  
      def one_vs_all_metric(metric, pos_label, y_true, y_pred):
          return metric(
              (y_true == pos_label).astype(int), y_pred[:, pos_label]
          )
  
      partial_metric = partial(one_vs_all_metric, metric, pos_label)
      sign = 1 if greater_is_better else -1
  
      def _scorer(clf, X, y):
          warnings.filterwarnings("ignore", category=UserWarning)
          y_pred = clf.predict_proba(X)
          warnings.filterwarnings("default", category=UserWarning)
          score = sign * partial_metric(y, y_pred)
          return score
  
      return _scorer
  
imports: from functools import partial
  import re
  from collections import Counter
  from typing import List, Union
  import warnings
  import numpy
  import pandas
  from pandas.api.types import is_numeric_dtype, is_categorical_dtype
  from dtreeviz.trees import ShadowDecTree
  from sklearn.metrics import make_scorer
  from sklearn.base import clone
  from sklearn.pipeline import Pipeline
  from sklearn.model_selection import KFold, StratifiedKFold
  from joblib import Parallel, delayed
label_desc: Use image node_id 16 for calling a global function with example usage: make_one_vs_all_scorer(metric, pos_label, greater_is_better) and returns: _scorer, metric, score