code: def test_classification_custom_metric(juice_dataframe):
      exp = pycaret.classification.ClassificationExperiment()
      # init setup
      exp.setup(
          juice_dataframe,
          target="Purchase",
          log_experiment=True,
          html=False,
          session_id=123,
          n_jobs=1,
      )
  
      # create a custom function (sklearn >=1.3.0 requires kwargs in func def)
      def specificity(y_true, y_pred, **kwargs):
          return recall_score(
              y_true, y_pred, pos_label=0, zero_division=1
          )
  
      # add metric to PyCaret
      exp.add_metric(
          "specificity",
          "specificity",
          specificity,
          greater_is_better=True,
      )
  
      lr = exp.create_model("lr")
      assert exp.pull()["specificity"].sum() != 0
  
      exp.predict_model(lr)
      assert exp.pull()["specificity"].sum() != 0
  
file_path: pycaret/tests/test_classification.py
imports: import uuid
  import pandas
  import pytest
  from mlflow.tracking import MlflowClient
  from sklearn.metrics import recall_score
  import pycaret.classification
  import pycaret.datasets
label_desc: Use image node_id 4 for calling a global function with example usage: test_classification_custom_metric(juice_dataframe) and returns: recall_score