class_docstr: Main class producing plots. Each create_*() method reads group data from base_path and creates a plot at the
  save_path. create_all_plots() runs all these functions at once.
class_docstr_tok: ["Main","class","producing","plots",".","Each","create_","*","(",")","method","reads","group","data","from","base_path","and","creates","a","plot","at","the","save_path",".","create_all_plots","(",")","runs","all","these","functions","at","once","."]
docstr: For each metric group, create a box-plot aggregating how correlated that metric group is with each other
  metric_group. Individual point correspond to the correlation (across models) of the two metric groups on a
  single scenario.
docstr_tok: ["For","each","metric","group",",","create","a","box-plot","aggregating","how","correlated","that","metric","group","is","with","each","other","metric_group",".","Individual","point","correspond","to","the","correlation","(","across","models",")","of","the","two","metric","groups","on","a","single","scenario","."]
code: def create_correlation_plots(self):
      """
      For each metric group, create a box-plot aggregating how correlated that metric group is with each other
      metric_group. Individual point correspond to the correlation (across models) of the two metric groups on a
      single scenario.
      """
      tables = self.get_group_tables("core_scenarios")
      metric_groups_shown = all_metric_groups
  
      num_columns = 3
      num_rows = (len(metric_groups_shown) - 2) // num_columns + 1
      fig, axarr = plt.subplots(
          num_rows,
          num_columns,
          figsize=(5.5 * num_columns, 4.5 * num_rows),
      )
  
      for i, metric_group_1 in enumerate(metric_groups_shown[:-1]):
          ax = axarr[i // num_columns][i % num_columns]
          group_to_values_1: Dict[str, np.ndarray] = {}
          for column in tables[metric_group_1].columns:
              if (
                  metric_group_1 == "Bias"
                  and column.metric != "Representation (gender)"
              ):
                  continue
              group_to_values_1[column.group] = column.values
  
          metric_group_to_correlations: Dict[
              str, np.ndarray
          ] = defaultdict(list)
          for j, metric_group_2 in enumerate(metric_groups_shown):
              for column in tables[metric_group_2].columns:
                  if (
                      metric_group_2 == "Bias"
                      and column.metric != "Representation (gender)"
                  ):
                      continue
                  if column.group not in group_to_values_1:
                      continue
                  values_1 = group_to_values_1[column.group]
                  values_2 = column.values
                  valid_values = np.logical_and(
                      ~np.isnan(values_1), ~np.isnan(values_2)
                  )
                  if sum(valid_values) >= 2:
                      correlation = pearsonr(
                          values_1[valid_values], values_2[valid_values]
                      )[0]
                      label = metric_group_to_label[metric_group_2]
                      metric_group_to_correlations[label].append(
                          correlation
                      )
          draw_box_plot(metric_group_to_correlations, ax)
          ax.set_title(metric_group_to_label[metric_group_1])
          if i % num_columns == 0:
              ax.set_ylabel("Pearson correlation")
  
      fig.subplots_adjust(wspace=0.25, hspace=0.45)
      self.save_figure(fig, "metric_correlation")
  
imports: import argparse
  from collections import defaultdict
  from dataclasses import dataclass
  from datetime import date
  import json
  import os
  from typing import List, Dict, Optional, Any, Callable, Union, Mapping, Tuple, Set
  import colorcet
  import matplotlib
  import matplotlib.pyplot
  import numpy
  from scipy.stats import pearsonr
  import seaborn
  from helm.common.hierarchical_logger import hlog
  from helm.benchmark.presentation.schema import read_schema
  from helm.benchmark.presentation.summarize import AGGREGATE_WIN_RATE_COLUMN
label_desc: Use image node_id 5 for calling the Plotter obj's underlying member method code with example usage: obj.create_correlation_plots() without return types