code: def test_compare_models(
      cross_validation, log_experiment, load_pos_and_neg_data
  ):
      """tests compare_models functionality"""
      exp = TSForecastingExperiment()
  
      fh = 12
      fold = 2
      data = load_pos_and_neg_data
  
      exp.setup(
          data=data,
          fh=fh,
          fold=fold,
          fold_strategy="expanding",
          verbose=False,
          session_id=42,
          log_experiment=log_experiment,
          log_plots=log_experiment,
      )
  
      best_baseline_models = exp.compare_models(
          n_select=3, cross_validation=cross_validation
      )
      assert len(best_baseline_models) == 3
      for best in best_baseline_models:
          assert not isinstance(best, ForecastingPipeline)
  
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 6 for calling a global function with example usage: test_compare_models(cross_validation, log_experiment, load_pos_and_neg_data) without return types