code: def _train_and_predict_gbm(
      input_features,
      output_features,
      tmpdir,
      backend_config,
      **trainer_config,
  ):
      csv_filename = os.path.join(tmpdir, "training.csv")
      dataset_filename = generate_data(
          input_features,
          output_features,
          csv_filename,
          num_examples=100,
      )
  
      config = {
          MODEL_TYPE: "gbm",
          INPUT_FEATURES: input_features,
          OUTPUT_FEATURES: output_features,
          # Disable feature filtering to avoid having no features due to small test dataset,
          # see https://stackoverflow.com/a/66405983/5222402
          TRAINER: {"num_boost_round": 2, "feature_pre_filter": False},
      }
  
      if trainer_config:
          config[TRAINER].update(trainer_config)
  
      config = ModelConfig.from_dict(config).to_dict()
  
      model = LudwigModel(config, backend=backend_config)
      _, _, output_directory = model.train(
          dataset=dataset_filename,
          output_directory=tmpdir,
          skip_save_processed_input=True,
          skip_save_progress=True,
          skip_save_unprocessed_output=True,
          skip_save_log=True,
      )
      model.load(os.path.join(tmpdir, "api_experiment_run", "model"))
      preds, _ = model.predict(
          dataset=dataset_filename,
          output_directory=output_directory,
          split="test",
      )
  
      return preds, model
  
imports: import os
  import numpy
  import pytest
  from ludwig.api import LudwigModel
  from ludwig.constants import INPUT_FEATURES, MODEL_TYPE, OUTPUT_FEATURES, TRAINER
  from ludwig.error import ConfigValidationError
  from ludwig.schema.model_types.base import ModelConfig
  from tests.integration_tests import synthetic_test_data
  from tests.integration_tests.utils import binary_feature
  from tests.integration_tests.utils import category_feature
  from tests.integration_tests.utils import generate_data, number_feature, text_feature
label_desc: Use image node_id 4 for calling a global function with example usage: _train_and_predict_gbm(input_features, output_features, tmpdir, backend_config) and returns: preds,  model