code: def plot_iterations(
      learner_names,
      metric_name,
      model_path,
      colors,
      trees_in_iteration=None,
  ):
      plt.figure(figsize=(10, 7))
      for ln in learner_names:
          df = pd.read_csv(
              os.path.join(model_path, f"{ln}_training.log"),
              names=["iteration", "train", "test"],
          )
  
          fold, repeat = learner_name_to_fold_repeat(ln)
          repeat_str = (
              f" Reapeat {repeat+1}," if repeat is not None else ""
          )
          # if trees_in_iteration is not None:
          #    df.iteration = df.iteration * trees_in_iteration
          any_none = np.sum(pd.isnull(df.train))
          if any_none == 0:
              plt.plot(
                  df.iteration,
                  df.train,
                  "--",
                  color=colors[fold],
                  label=f"Fold {fold+1},{repeat_str} train",
              )
          any_none = np.sum(pd.isnull(df.test))
          if any_none == 0:
              plt.plot(
                  df.iteration,
                  df.test,
                  color=colors[fold],
                  label=f"Fold {fold+1},{repeat_str} test",
              )
  
          best_iter = None
          if Metric.optimize_negative(metric_name):
              best_iter = df.test.argmax()
          else:
              best_iter = df.test.argmin()
  
          if best_iter is not None and best_iter != -1:
              plt.axvline(best_iter, color=colors[fold], alpha=0.3)
  
      if trees_in_iteration is not None:
          plt.xlabel("#Trees")
      else:
          plt.xlabel("#Iteration")
      plt.ylabel(metric_name)
  
      # limit number of learners in the legend
      # too many will raise warnings
      if len(learner_names) <= 15:
          plt.legend(loc="best")
  
      plt.tight_layout(pad=2.0)
      plot_path = os.path.join(
          model_path, LearningCurves.output_file_name
      )
      plt.savefig(plot_path)
      plt.close("all")
  
file_path: mljar-supervised/supervised/utils/learning_curves.py
imports: import logging
  import os
  import numpy
  import pandas
  from supervised.utils.common import learner_name_to_fold_repeat
  from supervised.utils.config import LOG_LEVEL
  from supervised.utils.metric import Metric
  import matplotlib.colors
  import matplotlib.pyplot
label_desc: Use image node_id 4 for calling the LearningCurves obj's underlying member method code with example usage: obj.plot_iterations(learner_names, metric_name, model_path, colors, trees_in_iteration) without return types