code: def _train_dataset_process(dataset_name, results_queue):
      """Runs each train job in a new process."""
      load_start_time = time.time()
      dataset = datasets.get_dataset(dataset_name)
      config = dataset.default_model_config
      df = dataset.load()
      load_end_time = time.time()
      if "split" not in df:
          df["split"] = 0
      available_splits = sorted(df.split.unique())
      results = TrainingResults(
          LUDWIG_VERSION,
          get_commit_hash(),
          dataset.version,
          dataset.name,
          config is not None,
          splits=" ".join([str(s) for s in available_splits]),
          load_time=load_end_time - load_start_time,
      )
      if config:
          dataset.export(".")
          print(f"Training {dataset_name}")
  
          # Train model on config
          train_start_time = time.time()
          model = LudwigModel(config)
          train_stats, _, output_directory = model.train(
              dataset=df, model_name=dataset_name
          )
  
          # If dataset has a test split with labels, evaluate on test set.  If not, evaluate on training set.
          evaluate_start_time = time.time()
          eval_stats, _, _ = model.evaluate(
              df,
              split=2 if 2 in available_splits else 0,
              collect_predictions=False,
              collect_overall_stats=True,
          )
          evaluate_end_time = time.time()
  
          # Visualize learning curve
          visualize.learning_curves(
              [train_stats],
              model_names=[dataset_name],
              output_directory=output_directory,
          )
  
          results.output_directory = output_directory
  
          # Get metric for first output feature
          first_of_name = config["output_features"][0]["name"]
          stats = eval_stats[first_of_name]
          if "accuracy" in stats:
              results.metric = "accuracy"
              results.performance = stats["accuracy"]
          elif "root_mean_squared_error" in stats:
              results.metric = "root_mean_squared_error"
              results.performance = stats["root_mean_squared_error"]
          elif "mean_squared_error" in stats:
              results.metric = "mean_squared_error"
              results.performance = stats["mean_squared_error"]
          elif "mean_absolute_error" in stats:
              results.metric = "mean_absolute_error"
              results.performance = stats["mean_absolute_error"]
          elif "loss" in stats:
              results.metric = "loss"
              results.performance = stats["loss"]
          results.train_time = evaluate_start_time - train_start_time
          results.eval_time = evaluate_end_time - evaluate_start_time
          print(
              f"Trained {dataset_name} in {evaluate_end_time - load_start_time:.2f} seconds"
          )
      results_queue.put(results)
  
file_path: ludwig/tests/ludwig/datasets/model_configs/train_all_model_configs.py
imports: import multiprocessing
  import time
  from dataclasses import dataclass
  from typing import Optional
  import pandas
  from ludwig import datasets, visualize
  from ludwig.api import LudwigModel
  from ludwig.globals import LUDWIG_VERSION
  from ludwig.utils.misc_utils import get_commit_hash
label_desc: Use image node_id 1 for calling a global function with example usage: _train_dataset_process(dataset_name, results_queue) without return types