class_docstr: Store resource usage diffs for two experiments.
class_docstr_tok: ["Store","resource","usage","diffs","for","two","experiments","."]
code: def to_string(self):
      ret = []
      spacing_str = "{:<36} {:<20} {:<20} {:<20} {:<5}"
      ret.append(
          spacing_str.format(
              "Metric Name",
              self.base_experiment_name,
              self.experimental_experiment_name,
              "Diff",
              "Diff Percentage",
          )
      )
      for metric in sorted(self.metrics, key=lambda m: m.name):
          diff_percentage = metric.diff_percentage
          if isinstance(metric.diff_percentage, float):
              diff_percentage = round(metric.diff_percentage, 3)
          ret.append(
              spacing_str.format(
                  metric.name,
                  metric.base_value_str,
                  metric.experimental_value_str,
                  metric.diff_str,
                  diff_percentage,
              )
          )
      return "\n".join(ret)
  
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 1 for calling the ResourceUsageDiff obj's underlying member method code with example usage: obj.to_string() and returns: str