code: def add_metric(
      id: str,
      name: str,
      score_func: type,
      target: str = "pred",
      greater_is_better: bool = True,
      multiclass: bool = True,
      **kwargs,
  ) -> pd.Series:
      """
      Adds a custom metric to be used in all functions.
  
  
      id: str
          Unique id for the metric.
  
  
      name: str
          Display name of the metric.
  
  
      score_func: type
          Score function (or loss function) with signature ``score_func(y, y_pred, **kwargs)``.
  
  
      target: str, default = 'pred'
          The target of the score function.
  
          - 'pred' for the prediction table
          - 'pred_proba' for pred_proba
          - 'threshold' for decision_function or predict_proba
  
  
      greater_is_better: bool, default = True
          Whether score_func is a score function (default), meaning high is good,
          or a loss function, meaning low is good. In the latter case, the
          scorer object will sign-flip the outcome of the score_func.
  
  
      multiclass: bool, default = True
          Whether the metric supports multiclass problems.
  
  
      **kwargs:
          Arguments to be passed to score function.
  
      Returns:
          pandas.Series
  
      """
  
      return _CURRENT_EXPERIMENT.add_metric(
          id=id,
          name=name,
          score_func=score_func,
          target=target,
          greater_is_better=greater_is_better,
          multiclass=multiclass,
          **kwargs,
      )
  
imports: import logging
  import os
  from typing import Any, BinaryIO, Callable, Dict, List, Optional, Union
  import pandas
  from joblib.memory import Memory
  from pycaret.clustering.oop import ClusteringExperiment
  from pycaret.loggers.base_logger import BaseLogger
  from pycaret.utils.constants import DATAFRAME_LIKE, SEQUENCE_LIKE
  from pycaret.utils.generic import check_if_global_is_not_none
label_desc: Use image node_id 15 for calling a global function with example usage: add_metric(id, name, score_func, target, greater_is_better, multiclass) and returns: _CURRENT_EXPERIMENT