code: def test_gridsearch(self):
      np.random.seed(1)
  
      dummy_series = get_dummy_series(ts_length=50)
      dummy_series_int_index = TimeSeries.from_values(
          dummy_series.values()
      )
  
      theta_params = {"theta": list(range(3, 10))}
      assert compare_best_against_random(
          Theta, theta_params, dummy_series
      )
      assert compare_best_against_random(
          Theta, theta_params, dummy_series_int_index
      )
      assert compare_best_against_random(
          Theta, theta_params, dummy_series, stride=2
      )
  
      fft_params = {
          "nr_freqs_to_keep": [10, 50, 100],
          "trend": [None, "poly", "exp"],
      }
      assert compare_best_against_random(FFT, fft_params, dummy_series)
  
      es_params = {"seasonal_periods": list(range(5, 10))}
      assert compare_best_against_random(
          ExponentialSmoothing, es_params, dummy_series
      )
  
imports: import random
  from itertools import product
  import numpy
  import pandas
  import pytest
  from darts import TimeSeries
  from darts.datasets import AirPassengersDataset, MonthlyMilkDataset
  from darts.logging import get_logger
  from darts.metrics import mape, r2_score
  from darts.models import ARIMA, FFT, ExponentialSmoothing, NaiveDrift, NaiveSeasonal, Theta
  from darts.tests.conftest import tfm_kwargs
  from darts.utils.timeseries_generation import gaussian_timeseries
  from darts.utils.timeseries_generation import linear_timeseries
  from darts.utils.timeseries_generation import random_walk_timeseries
  from darts.utils.timeseries_generation import sine_timeseries
label_desc: Use image node_id 5 for calling the TestBacktesting obj's underlying member method code with example usage: obj.test_gridsearch() without return types