code: def evaluate_classifier_with_probabilities(
      model, data, probabilities="probabilities", verbose=False
  ):
      """
      Evaluate a classifier specification for testing.
  
      Parameters
      ----------
      filename: [str | Model]
          File from where to load the model from (OR) a loaded
          version of the MLModel.
  
      data: [str | Dataframe]
          Test data on which to evaluate the models (dataframe,
          or path to a csv file).
  
      probabilities: str
         Column to interpret as the probabilities column
  
      verbose: bool
         Verbosity levels of the predictions.
      """
  
      model = _get_model(model)
      if verbose:
          print("")
          print("Other Framework\t\tPredicted")
  
      max_probability_error, num_key_mismatch = 0, 0
  
      for _, row in data.iterrows():
          input_dict = {
              k: v for k, v in dict(row).items() if k != probabilities
          }
          _remove_invalid_keys(input_dict, model)
          predicted_values = model.predict(input_dict)[
              _to_unicode(probabilities)
          ]
          other_values = row[probabilities]
  
          if set(predicted_values.keys()) != set(other_values.keys()):
              if verbose:
                  print(
                      "Different classes: ",
                      str(predicted_values.keys()),
                      str(other_values.keys()),
                  )
              num_key_mismatch += 1
              continue
  
          for (
              cur_class,
              cur_predicted_class_values,
          ) in predicted_values.items():
              delta = (
                  cur_predicted_class_values - other_values[cur_class]
              )
              if verbose:
                  print(
                      delta,
                      cur_predicted_class_values,
                      other_values[cur_class],
                  )
  
              max_probability_error = max(
                  abs(delta), max_probability_error
              )
  
          if verbose:
              print("")
  
      ret = {
          "num_samples": len(data),
          "max_probability_error": max_probability_error,
          "num_key_mismatch": num_key_mismatch,
      }
  
      if verbose:
          print("results: {}".format(ret))
  
      return ret
  
imports: from collections.abc import Iterable
  from functools import lru_cache
  import math
  import os
  import shutil
  import subprocess
  import sys
  import tempfile
  from typing import Optional, Union
  import warnings
  import numpy
  import coremltools
  from coremltools import ComputeUnit
  from coremltools.converters.mil.mil.passes.defs.preprocess import NameSanitizer
  from coremltools.proto import Model_pb2
  import coremltools.proto.MIL_pb2
  from .._deps import _HAS_SCIPY
label_desc: Use image node_id 15 for calling a global function with example usage: evaluate_classifier_with_probabilities(model, data, probabilities, verbose) and returns: ret