code: def _compute_metrics(df: pd.DataFrame, metrics: List[str]):
      """
      Compute metrics for one data frame.
  
      :param df: The data frame which contains actual_level and predicted_level columns.
      :return: The data frame with two columns - metric_name and metric.
      """
      scores = scoring.score_regression(
          y_test=df[ACTUALS], y_pred=df[PREDICTIONS], metrics=metrics
      )
      metrics_df = pd.DataFrame(
          list(scores.items()), columns=["metric_name", "metric"]
      )
      metrics_df.sort_values(["metric_name"], inplace=True)
      metrics_df.reset_index(drop=True, inplace=True)
      return metrics_df
  
file_path: MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/forecasting-backtest-many-models/assets/score.py
imports: from typing import Any, Dict, Optional, List
  import argparse
  import json
  import os
  import re
  import numpy
  import pandas
  from matplotlib import pyplot
  from matplotlib.backends.backend_pdf import PdfPages
  from azureml.automl.core.shared import constants
  from azureml.automl.core.shared.types import GrainType
  from azureml.automl.runtime.shared.score import scoring
label_desc: Use image node_id 1 for calling a global function with example usage: _compute_metrics(df, metrics) and returns: metrics_df