code: def plot_pareto(
      smac: AbstractFacade, incumbents: list[Configuration]
  ) -> None:
      """Plots configurations from SMAC and highlights the best configurations in a Pareto front."""
      average_costs = []
      average_pareto_costs = []
      for config in smac.runhistory.get_configs():
          # Since we use multiple seeds, we have to average them to get only one cost value pair for each configuration
          average_cost = smac.runhistory.average_cost(config)
  
          if config in incumbents:
              average_pareto_costs += [average_cost]
          else:
              average_costs += [average_cost]
  
      # Let's work with a numpy array
      costs = np.vstack(average_costs)
      pareto_costs = np.vstack(average_pareto_costs)
      pareto_costs = pareto_costs[
          pareto_costs[:, 0].argsort()
      ]  # Sort them
  
      costs_x, costs_y = costs[:, 0], costs[:, 1]
      pareto_costs_x, pareto_costs_y = (
          pareto_costs[:, 0],
          pareto_costs[:, 1],
      )
  
      plt.scatter(costs_x, costs_y, marker="x", label="Configuration")
      plt.scatter(
          pareto_costs_x,
          pareto_costs_y,
          marker="x",
          c="r",
          label="Incumbent",
      )
      plt.step(
          [pareto_costs_x[0]]
          + pareto_costs_x.tolist()
          + [np.max(costs_x)],  # We add bounds
          [np.max(costs_y)]
          + pareto_costs_y.tolist()
          + [np.min(pareto_costs_y)],  # We add bounds
          where="post",
          linestyle=":",
      )
  
      plt.title("Pareto-Front")
      plt.xlabel(smac.scenario.objectives[0])
      plt.ylabel(smac.scenario.objectives[1])
      plt.legend()
      plt.show()
  
file_path: SMAC3/examples/3_multi_objective/2_parego.py
imports: from __future__ import annotations
  import time
  import warnings
  import matplotlib.pyplot
  import numpy
  from ConfigSpace import Categorical, Configuration, ConfigurationSpace, EqualsCondition, Float, InCondition, Integer
  from sklearn.datasets import load_digits
  from sklearn.model_selection import StratifiedKFold, cross_val_score
  from sklearn.neural_network import MLPClassifier
  from smac import HyperparameterOptimizationFacade
  from smac import Scenario
  from smac.facade.abstract_facade import AbstractFacade
  from smac.multi_objective.parego import ParEGO
label_desc: Use image node_id 1 for calling a global function with example usage: plot_pareto(smac, incumbents) without return types