code: def plot_model_parameter_randomisation_experiment(
      results: Dict[str, dict],
      methods=None,
      *args,
      **kwargs,
  ) -> None:
      """
      Plot the model parameter randomisation experiment as done in paper:
  
      References:
          1) Adebayo, J., Gilmer, J., Muelly, M., Goodfellow, I., Hardt, M., and Kim, B. "Sanity Checks for Saliency Maps."
          arXiv preprint, arXiv:1810.073292v3 (2018)
  
      Parameters
      ----------
      results: list, dict
          The results fromm the Selectivity experiment(s).
      args: optional
          Arguments.
      kwargs: optional
          Keyword arguments.
  
      Returns
      -------
      None
      """
  
      fig = plt.figure(figsize=(8, 6))
  
      if methods:
          for method in methods:
              for _ in results[method]:
                  layers = list(results[method].keys())
                  scores: Dict[Any, Any] = {k: [] for k in layers}
                  # samples = len(results[method])
                  # for s in range(samples):
                  for layer in layers:
                      scores[layer].append(results[method][layer])
  
              plt.plot(
                  layers,
                  [np.mean(v) for k, v in scores.items()],
                  label=method,
              )
      else:
          layers = list(results.keys())
          scores = {k: [] for k in layers}
          # samples = len(results)
          # for s in range(samples):
          for layer in layers:
              scores[layer].append(results[layer])
  
          plt.plot(layers, [np.mean(v) for k, v in scores.items()])
  
      plt.xticks(rotation=90)
      plt.xlabel("Layers")
      plt.ylabel(kwargs.get("similarity_metric", "Score"))
  
      if methods:
          plt.legend(methods)
      plt.show()
  
file_path: Quantus/quantus/helpers/plotting.py
imports: from typing import List, Union, Dict, Any
  import matplotlib.pyplot
  import numpy
  from quantus.helpers import warn
label_desc: Use image node_id 5 for calling a global function with example usage: plot_model_parameter_randomisation_experiment(results, methods) without return types