code: def _generate_learning_curve_score_plots(
      df_scores: pd.DataFrame,
      num_metrics: int,
      num_learners: int,
      experiment_name: str,
      output_dir: PathOrStr,
      rotate_labels: bool = False,
  ) -> None:
      """
      Generate learning curve score plots, one per featureset.
  
      This function generates score-based learning curve plots, i.e., plots
      where the training set size is on the x-axis and the training and
      cross-validation scores are on the y-axis. The plots are faceted, with
      different metrics along the rows and different learners along the columns.
  
      Parameters
      ----------
      df_scores : pandas.DataFrame
          The pandas data frame containing the various scores to be plotted.
      num_metrics : int
          The number of metrics specified in the experiment.
      num_learners: int
          The number of learners specified in the experiment.
      experiment_name : str
          The name of the experiment.
      output_dir : :class:`skll.types.PathOrStr`
          Path to the output directory for the plots.
      rotate_labels : bool, default=False
          Whether to rotate the x-axis labels for the training data size.
      """
      # convert output dir to a path
      output_dir = Path(output_dir)
  
      # set up and draw the actual learning curve figures, one for
      # each of the featuresets
      for fs_name, df_fs in df_scores.groupby("featureset_name"):
          fig = plt.figure()
          fig.set_size_inches(2.5 * num_learners, 2.5 * num_metrics)
  
          # compute ylimits for this feature set for each objective
          with sns.axes_style(
              "whitegrid",
              {"grid.linestyle": ":", "xtick.major.size": 3.0},
          ):
              g = sns.FacetGrid(
                  df_fs,
                  row="metric",
                  col="learner_name",
                  height=2.5,
                  aspect=1,
                  margin_titles=True,
                  despine=True,
                  sharex=False,
                  sharey=False,
                  legend_out=False,
              )
              train_color, test_color = sns.color_palette(
                  palette="Set1", n_colors=2
              )
              g = g.map_dataframe(
                  sns.pointplot,
                  x="training_set_size",
                  y="value",
                  hue="variable",
                  scale=0.5,
                  errorbar=None,
                  palette={
                      "train_score_mean": train_color,
                      "test_score_mean": test_color,
                  },
              )
              ylimits = _compute_ylimits_for_featureset(
                  df_fs, g.row_names
              )
              for ax in g.axes.flat:
                  plt.setp(ax.texts, text="")
              g = g.set_titles(
                  row_template="", col_template="{col_name}"
              ).set_axis_labels("Training Examples", "Score")
              if rotate_labels:
                  g = g.set_xticklabels(rotation=60)
  
              for i, row_name in enumerate(g.row_names):
                  for j, col_name in enumerate(g.col_names):
                      ax = g.axes[i][j]
                      ax.set(ylim=ylimits[row_name])
                      df_ax_train = df_fs[
                          (df_fs["learner_name"] == col_name)
                          & (df_fs["metric"] == row_name)
                          & (df_fs["variable"] == "train_score_mean")
                      ]
                      df_ax_test = df_fs[
                          (df_fs["learner_name"] == col_name)
                          & (df_fs["metric"] == row_name)
                          & (df_fs["variable"] == "test_score_mean")
                      ]
                      ax.fill_between(
                          list(range(len(df_ax_train))),
                          df_ax_train["value"]
                          - df_ax_train["train_score_std"],
                          df_ax_train["value"]
                          + df_ax_train["train_score_std"],
                          alpha=0.1,
                          color=train_color,
                      )
                      ax.fill_between(
                          list(range(len(df_ax_test))),
                          df_ax_test["value"]
                          - df_ax_test["test_score_std"],
                          df_ax_test["value"]
                          + df_ax_test["test_score_std"],
                          alpha=0.1,
                          color=test_color,
                      )
                      if j == 0:
                          ax.set_ylabel(row_name)
                          if i == 0:
                              # set up the legend handles for this plot
                              plot_handles = [
                                  matplotlib.lines.Line2D(
                                      [],
                                      [],
                                      color=color,
                                      label=label,
                                      linestyle="-",
                                  )
                                  for color, label in zip(
                                      [train_color, test_color],
                                      ["Training", "Cross-validation"],
                                  )
                              ]
                              ax.legend(
                                  handles=plot_handles,
                                  loc=4,
                                  fancybox=True,
                                  fontsize="x-small",
                                  ncol=1,
                                  frameon=True,
                              )
              g.fig.tight_layout(w_pad=1)
              plt.savefig(
                  output_dir / f"{experiment_name}_{fs_name}.png",
                  dpi=300,
              )
              # explicitly close figure to save memory
              plt.close(fig)
  
imports: from __future__ import annotations
  import csv
  import json
  import math
  import sys
  from collections import defaultdict
  from pathlib import Path
  from typing import IO, Any, Dict, List, Tuple
  import matplotlib
  import matplotlib.pyplot
  import numpy
  import pandas
  import seaborn
  from ruamel.yaml import YAML
  from skll.types import FoldMapping, PathOrStr
  from skll.utils.logging import get_skll_logger
label_desc: Use image node_id 2 for calling a global function with example usage: _generate_learning_curve_score_plots(df_scores, num_metrics, num_learners, experiment_name, output_dir, rotate_labels) without return types