code: def train_and_predict_model_with_stratified_split(
      input_features, output_features, data_csv, output_directory
  ):
      """Same as above, but with stratified split."""
      print(
          f'output_features[0]["column"]: {output_features[0]["column"]}'
      )
      config = {
          "input_features": input_features,
          "output_features": output_features,
          TRAINER: {"epochs": 2, BATCH_SIZE: 128},
          "preprocessing": {
              "split": {
                  "column": output_features[0]["column"],
                  "probabilities": [0.7, 0.1, 0.2],
                  "type": "stratify",
              },
          },
      }
      model = LudwigModel(config, backend=LocalTestBackend())
      model.train(
          dataset=data_csv,
          skip_save_processed_input=True,
          skip_save_progress=True,
          skip_save_unprocessed_output=True,
          output_directory=output_directory,
      )
      model.predict(dataset=data_csv, output_directory=output_directory)
      return model
  
file_path: ludwig/tests/integration_tests/test_server.py
imports: import json
  import logging
  import os
  import sys
  import numpy
  import pytest
  from ludwig.api import LudwigModel
  from ludwig.constants import BATCH_SIZE, DECODER, TRAINER
  from ludwig.serve import server
  from ludwig.utils.data_utils import read_csv
  from tests.integration_tests.utils import audio_feature, category_feature, generate_data, image_feature, LocalTestBackend, number_feature, text_feature
label_desc: Use image node_id 2 for calling a global function with example usage: train_and_predict_model_with_stratified_split(input_features, output_features, data_csv, output_directory) and returns: model