code: def test_save_load_model_setup(load_pos_and_neg_data):
      """Tests the save_model and load_model functionality with setup.
      Applicable when user saves the model (without pipeline), then loads the model,
      runs setup and uses this model.
      """
  
      fh = np.arange(1, 13)
      fold = 2
      data = load_pos_and_neg_data
  
      ######################
      # OOP Approach ####
      ######################
      exp = TSForecastingExperiment()
      exp.setup(
          data=data,
          fh=fh,
          fold=fold,
          fold_strategy="sliding",
          verbose=False,
          session_id=42,
      )
  
      model = exp.create_model("ets")
      expected_predictions = exp.predict_model(model)
      exp.save_model(
          model, "model_unit_test_oop_setup", model_only=True
      )
  
      # Mimic loading in another session - Predictions with setup
      exp_loaded = TSForecastingExperiment()
      exp_loaded.setup(
          data=data,
          fh=fh,
          fold=fold,
          fold_strategy="sliding",
          verbose=False,
          session_id=42,
      )
      loaded_model = exp_loaded.load_model("model_unit_test_oop_setup")
      loaded_predictions = exp_loaded.predict_model(loaded_model)
  
      assert np.all(loaded_predictions == expected_predictions)
  
      ########################
      # Functional API ####
      ########################
      from pycaret.time_series import (
          create_model,
          load_model,
          predict_model,
          save_model,
          setup,
      )
  
      _ = setup(
          data=data,
          fh=fh,
          fold=fold,
          fold_strategy="expanding",
          session_id=42,
          n_jobs=-1,
      )
      model = create_model("naive")
      expected_predictions = predict_model(model)
      save_model(model, "model_unit_test_func_setup", model_only=True)
  
      # Mimic loading in another session - Predictions with setup
      setup(
          data=data,
          fh=fh,
          fold=fold,
          fold_strategy="sliding",
          verbose=False,
          session_id=42,
      )
      loaded_model = load_model("model_unit_test_func_setup")
      loaded_predictions = predict_model(loaded_model)
  
      assert np.all(loaded_predictions == expected_predictions)
  
file_path: pycaret/tests/test_time_series_base.py
imports: import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
  from sktime.forecasting.compose import ForecastingPipeline
  from time_series_test_utils import _return_compare_model_args, _return_model_parameters
  from pycaret.time_series import TSForecastingExperiment
label_desc: Use image node_id 8 for calling a global function with example usage: test_save_load_model_setup(load_pos_and_neg_data) without return types