code: def compare_plot(benchmarks):
      explainer_metrics = get_metrics(
          benchmarks, lambda x, y: x.intersection(y)
      )
      explainers = list(benchmarks.keys())
      num_explainers = len(explainers)
      num_metrics = len(explainer_metrics)
  
      # dummy start to evenly distribute explainers on the left
      # can later be replaced by boolean metrics
      aucs = dict()
      for i in range(num_explainers):
          explainer = explainers[i]
          aucs[explainer] = [i / (num_explainers - 1)]
  
      # normalize per metric
      for metric in explainer_metrics:
          max_auc, min_auc = -float("inf"), float("inf")
  
          for explainer in explainers:
              scores = benchmarks[explainer]
              _, _, auc = scores["values"][metric]
              min_auc = min(auc, min_auc)
              max_auc = max(auc, max_auc)
  
          for explainer in explainers:
              scores = benchmarks[explainer]
              _, _, auc = scores["values"][metric]
              aucs[explainer].append(
                  (auc - min_auc) / (max_auc - min_auc)
              )
  
      # plot common curves
      ax = plt.gca()
      for explainer in explainers:
          plt.plot(
              np.linspace(0, 1, len(explainer_metrics) + 1),
              aucs[explainer],
              "--o",
          )
  
      ax.tick_params(which="major", axis="both", labelsize=8)
  
      ax.set_yticks(
          [i / (num_explainers - 1) for i in range(0, num_explainers)]
      )
      ax.set_yticklabels(explainers, rotation=0)
  
      ax.set_xticks(np.linspace(0, 1, num_metrics + 1))
      ax.set_xticklabels(
          [" "] + explainer_metrics, rotation=45, ha="right"
      )
  
      plt.grid(which="major", axis="x", linestyle="--")
      plt.tight_layout()
      plt.ylabel("Relative Performance of Each Explanation Method")
      plt.xlabel("Evaluation Metrics")
      plt.title("Explanation Method Performance Across Metrics")
      plt.show()
  
file_path: shap/shap/benchmark/framework.py
imports: import itertools
  import matplotlib.pyplot
  import numpy
  import pandas
  from .None import perturbation
label_desc: Use image node_id 5 for calling a global function with example usage: compare_plot(benchmarks) without return types