code: def build_metrics_diff(
      dataset_name: str,
      base_experiment_name: str,
      experimental_experiment_name: str,
      local_directory: str,
  ) -> MetricsDiff:
      """Build a MetricsDiff object between two experiments on a dataset.
  
      :param dataset_name: the name of the Ludwig dataset.
      :param base_experiment_name: the name of the base experiment.
      :param experimental_experiment_name: the name of the experimental experiment.
      :param local_directory: the local directory where the experiment artifacts are downloaded.
      """
      base_summary: MetricsSummary = build_metrics_summary(
          os.path.join(
              local_directory, dataset_name, base_experiment_name
          )
      )
      experimental_summary: MetricsSummary = build_metrics_summary(
          os.path.join(
              local_directory,
              dataset_name,
              experimental_experiment_name,
          )
      )
  
      metrics_in_common = set(base_summary.metric_names).intersection(
          set(experimental_summary.metric_names)
      )
  
      metrics: List[MetricDiff] = [
          build_diff(
              name,
              base_summary.metric_to_values[name],
              experimental_summary.metric_to_values[name],
          )
          for name in metrics_in_common
      ]
  
      return MetricsDiff(
          dataset_name=dataset_name,
          base_experiment_name=base_experiment_name,
          experimental_experiment_name=experimental_experiment_name,
          local_directory=local_directory,
          base_summary=base_summary,
          experimental_summary=experimental_summary,
          metrics=metrics,
      )
  
imports: import csv
  import logging
  import os
  from dataclasses import dataclass
  from statistics import mean
  from typing import Dict, List, Optional, Set, Union
  import ludwig.modules.metric_modules
  from ludwig.benchmarking.utils import format_memory, format_time
  from ludwig.globals import MODEL_HYPERPARAMETERS_FILE_NAME
  from ludwig.modules.metric_registry import get_metric_classes, metric_feature_type_registry
  from ludwig.types import ModelConfigDict
  from ludwig.utils.data_utils import load_json
label_desc: Use image node_id 4 for calling a global function with example usage: build_metrics_diff(dataset_name, base_experiment_name, experimental_experiment_name, local_directory) and returns: MetricsDiff