code: def create_metrics_plot(metrics):
      # Deactivate the resampler since it is not compatible with kaleido (image export)
      unregister_plotly_resampler()
  
      # Plotly params
      prediction_color = "#2d92ff"
      actual_color = "black"
      line_width = 2
      xaxis_args = {
          "showline": True,
          "mirror": True,
          "linewidth": 1.5,
          "showgrid": False,
      }
      yaxis_args = {
          "showline": True,
          "mirror": True,
          "linewidth": 1.5,
          "showgrid": False,
          "rangemode": "tozero",
          "type": "log",
      }
      layout_args = {
          "autosize": True,
          "template": "plotly_white",
          "margin": go.layout.Margin(l=0, r=10, b=0, t=30, pad=0),
          "font": dict(size=10),
          "title": dict(font=dict(size=10)),
          "width": 1000,
          "height": 200,
      }
  
      metric_cols = [
          col
          for col in metrics.columns
          if not ("_val" in col or col == "RegLoss" or col == "epoch")
      ]
      fig = make_subplots(
          rows=1, cols=len(metric_cols), subplot_titles=metric_cols
      )
      for i, metric in enumerate(metric_cols):
          fig.add_trace(
              go.Scatter(
                  y=metrics[metric],
                  name=metric,
                  mode="lines",
                  line=dict(color=prediction_color, width=line_width),
                  legendgroup=metric,
              ),
              row=1,
              col=i + 1,
          )
          if f"{metric}_val" in metrics.columns:
              fig.add_trace(
                  go.Scatter(
                      y=metrics[f"{metric}_val"],
                      name=f"{metric}_val",
                      mode="lines",
                      line=dict(color=actual_color, width=line_width),
                      legendgroup=metric,
                  ),
                  row=1,
                  col=i + 1,
              )
          if metric == "Loss":
              fig.add_trace(
                  go.Scatter(
                      y=metrics["RegLoss"],
                      name="RegLoss",
                      mode="lines",
                      line=dict(color=actual_color, width=line_width),
                      legendgroup=metric,
                  ),
                  row=1,
                  col=i + 1,
              )
      fig.update_xaxes(xaxis_args)
      fig.update_yaxes(yaxis_args)
      fig.update_layout(layout_args)
      return fig
  
file_path: neural_prophet/tests/test_model_performance.py
imports: import json
  import logging
  import os
  import pathlib
  import time
  import numpy
  import pandas
  import plotly.graph_objects
  from plotly.subplots import make_subplots
  from plotly_resampler import unregister_plotly_resampler
  from neuralprophet import NeuralProphet, set_random_seed
label_desc: Use image node_id 2 for calling a global function with example usage: create_metrics_plot(metrics) and returns: fig