code: def print_table_for_single_output_feature(
      train_metrics_log: Dict[str, List[TrainerMetric]],
      validation_metrics_log: Dict[str, List[TrainerMetric]],
      test_metrics_log: Dict[str, List[TrainerMetric]],
      combined_loss_for_each_split: List[float],
  ) -> None:
      """Prints the metrics table for a single output feature.
  
      Args:
          train_metrics_log: Dict from metric name to list of TrainerMetric.
          validation_metrics_log: Dict from metric name to list of TrainerMetric.
          test_metrics_log: Dict from metric name to list of TrainerMetric.
      """
      # Get the superset of metric names across all splits.
      all_metric_names = set()
      all_metric_names.update(train_metrics_log.keys())
      all_metric_names.update(validation_metrics_log.keys())
      all_metric_names.update(test_metrics_log.keys())
      all_metric_names = sorted(list(all_metric_names))
  
      # Assemble the printed table.
      # Each item in the printed_table corresponds to a row in the printed table.
      printed_table = [["train", "validation", "test"]]
      for metric_name in all_metric_names:
          metrics_for_each_split = [
              get_metric_value_or_empty(train_metrics_log, metric_name),
              get_metric_value_or_empty(
                  validation_metrics_log, metric_name
              ),
              get_metric_value_or_empty(test_metrics_log, metric_name),
          ]
          printed_table.append([metric_name] + metrics_for_each_split)
  
      # Add combined loss.
      printed_table.append(
          ["combined_loss"] + combined_loss_for_each_split
      )
  
      logger.info(
          tabulate(
              printed_table,
              headers="firstrow",
              tablefmt="fancy_grid",
              floatfmt=".4f",
          )
      )
  
file_path: ludwig/ludwig/utils/metrics_printed_table.py
imports: import logging
  from typing import Dict, List
  from tabulate import tabulate
  from ludwig.constants import COMBINED, LOSS
  from ludwig.utils.metric_utils import TrainerMetric
label_desc: Use image node_id 2 for calling a global function with example usage: print_table_for_single_output_feature(train_metrics_log, validation_metrics_log, test_metrics_log, combined_loss_for_each_split) without return types