docstr: Tests the argument for auto model selection will pick the
  model with the lowest error.
docstr_tok: ["Tests","the","argument","for","auto","model","selection","will","pick","the","model","with","the","lowest","error","."]
code: def test_auto_model_selection(self, mock_handler):
      """Tests the argument for auto model selection will pick the
      model with the lowest error.
      """
      # create project
      self.run_sql("create database proj")
      self.set_handler(
          mock_handler, name="pg", tables={"df": AirPassengersDF}
      )
  
      # generate ground truth predictions from the package - AutoTheta should win here
      prediction_horizon = 1
      sf = StatsForecast(
          models=[m(season_length=12) for m in model_dict.values()],
          freq="M",
          df=AirPassengersDF,
      )
      sf.cross_validation(prediction_horizon, fitted=True)
      sf_results_df = sf.cross_validation_fitted_values()
      best_model_name = get_best_model_from_results_df(sf_results_df)
      package_predictions = sf.forecast(prediction_horizon)[
          best_model_name
      ]
  
      # 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='auto',
               frequency='M'
          """
      )
      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 np.allclose(mindsdb_result, package_predictions)
  
      describe_result = self.run_sql("describe proj.modelx")
      assert len(describe_result["accuracies"][0]) > 1
      assert type(describe_result["accuracies"][0][0][0]) == str
      assert describe_result["accuracies"][0][0][1] < 1
  
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 5 for calling the TestStatsForecast obj's underlying member method code with example usage: obj.test_auto_model_selection(mock_handler) without return types