docstr: This tests whether changing the model_name and frequency USING args
  will switch the actual model used.
docstr_tok: ["This","tests","whether","changing","the","model_name","and","frequency","USING","args","will","switch","the","actual","model","used","."]
code: def test_model_choice(self, mock_handler):
      """This tests whether changing the model_name and frequency USING args
      will switch the actual model used.
      """
  
      # create project
      self.run_sql("create database proj")
      df = pd.read_parquet(
          "https://datasets-nixtla.s3.amazonaws.com/m4-hourly.parquet"
      )
      df = df[df.unique_id.isin(["H1", "H2", "H3"])]  # subset for speed
      n_groups = df["unique_id"].nunique()
      self.set_handler(mock_handler, name="pg", tables={"df": df})
  
      # generate ground truth predictions from the package
      prediction_horizon = 4
      sf = StatsForecast(models=[AutoCES(season_length=24)], freq="H")
      sf.fit(df)
      forecast_df = sf.predict(prediction_horizon)
      package_predictions = forecast_df.reset_index(drop=True).iloc[
          :, -1
      ]
  
      # create predictor
      self.run_sql(
          f"""
             create model proj.modelx
             from pg (select * from df)
             predict y
             order by ds
             group by unique_id
             horizon {prediction_horizon}
             using
               engine='statsforecast',
               model_name='AutoCES',
               frequency='H'
          """
      )
      self.wait_predictor("proj", "modelx")
  
      # run predict
      result_df = self.run_sql(
          """
             SELECT p.*
             FROM pg.df as t
             JOIN proj.modelx as p
          """
      )
  
      # check against ground truth
      mindsdb_result = result_df.iloc[:, -1]
      assert len(mindsdb_result) == prediction_horizon * n_groups
      assert np.allclose(mindsdb_result, package_predictions)
  
      # test describe() method, which should return a df row with keys
      # {"inputs": [features], "outputs": <target_name>, "accuracies": [model_accuracies]}
      describe_result = self.run_sql("describe proj.modelx")
      assert describe_result["inputs"][0] == ["y", "ds", ["unique_id"]]
      assert describe_result["outputs"][0] == "y"
      # The expected format of the "accuracies" key is
      # [(model_1_name, model_1_accuracy), (model_2_name, model_2_accuracy), ...]
      assert describe_result["accuracies"][0][0][0] == "AutoCES"
      assert describe_result["accuracies"][0][0][1] < 1
  
      describe_model = self.run_sql("describe proj.modelx.model")
      assert describe_model["model_name"][0] == "AutoCES"
      assert describe_model["frequency"][0] == "H"
      assert describe_model["season_length"][0] == 24
  
      describe_features = self.run_sql("describe proj.modelx.features")
      assert describe_features["ds"][0] == "ds"
      assert describe_features["y"][0] == "y"
      assert describe_features["unique_id"][0] == ["unique_id"]
  
      with pytest.raises(Exception) as e:
          self.run_sql("describe proj.modelx.ensemble")
          assert "ensemble is not supported" in str(e)
  
imports: import time
  from unittest.mock import patch
  import numpy
  import pandas
  import pytest
  from statsforecast.models import AutoCES
  from statsforecast.utils import AirPassengersDF
  from statsforecast import StatsForecast
  from mindsdb.integrations.utilities.time_series_utils import get_best_model_from_results_df
  from mindsdb.integrations.handlers.statsforecast_handler.statsforecast_handler import choose_model, model_dict, get_insample_cv_results
  from mindsdb_sql import parse_sql
  from tests.unit.ml_handlers.test_time_series_utils import create_mock_df
  from tests.unit.executor_test_base import BaseExecutorTest
label_desc: Use image node_id 4 for calling the TestStatsForecast obj's underlying member method code with example usage: obj.test_model_choice(mock_handler) without return types