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: Plot model performance as a function of in-context examples used. One plot per scenario, one line per model.
  We retrieve the actual average number of in-context examples used from the "General information" table.
docstr_tok: ["Plot","model","performance","as","a","function","of","in-context","examples","used",".","One","plot","per","scenario",",","one","line","per","model",".","We","retrieve","the","actual","average","number","of","in-context","examples","used","from","the","``","General","information","''","table","."]
code: def create_in_context_examples_plot(self):
      """
      Plot model performance as a function of in-context examples used. One plot per scenario, one line per model.
      We retrieve the actual average number of in-context examples used from the "General information" table.
      """
      tables = self.get_group_tables("ablation_in_context")
  
      group_to_num_examples: Dict[str, np.ndarray] = {}
      for column in tables["General information"].columns:
          if "# train" in column.name:
              group_to_num_examples[column.group] = column.values
  
      table = tables["Accuracy"]
      n = len(table.columns)
      fig, axarr = plt.subplots(1, n, figsize=(3.5 * n, 2.5))
      for i, column in enumerate(table.columns):
          model_examples_to_accuracy: Dict[
              str, Dict[float, float]
          ] = defaultdict(dict)
          for adapter, accuracy, num_examples in zip(
              table.adapters,
              column.values,
              group_to_num_examples[column.group],
          ):
              model = adapter.split(" [")[0]
              model_examples_to_accuracy[model][num_examples] = accuracy
  
          ax = axarr[i]
          for (
              model,
              examples_to_accuracy,
          ) in model_examples_to_accuracy.items():
              if "UL2" in model:
                  continue
              offset = 2
              xs: List[int] = []
              ys: List[float] = []
              for x, y in sorted(examples_to_accuracy.items()):
                  xs.append(x)
                  ys.append(y)
              ax.semilogx(
                  [x + offset for x in xs],
                  ys,
                  label=model,
                  marker="o",
                  base=2,
              )
              xs_max = [0] + [2**i for i in range(5)]
              ax.set_xticks([x + offset for x in xs_max], xs_max)
              ax.set_title(column.group)
              ax.set_ylabel(column.metric)
              ax.set_xlabel("#in-context examples")
              if i == 0:
                  ax.legend(
                      ncol=5, loc="upper left", bbox_to_anchor=(0, 1.45)
                  )
      fig.subplots_adjust(wspace=0.32, hspace=0.5)
      self.save_figure(fig, "in_context_ablations")
  
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 14 for calling the Plotter obj's underlying member method code with example usage: obj.create_in_context_examples_plot() without return types