code: def cross_validation_time_series(
      model, df, preds, target, n_times=10, verbose=0
  ):
      """
      This splits a time series data frame "n" times as specified in the input (default=10)
      Initially it will start with a certain number of rows in train but it will gradually
      increase train size in steps (which it will calculate automatically) while the
      number of test rows will remain the same (though their content will vary).
      This utility is based on sklearn's time_series_split()
      """
      if n_times > 10:
          print(
              "More than 10 splits is not recommended. Setting n_times to 10"
          )
          n_times = 10
      splits = TimeSeriesSplit(n_splits=n_times)
      index = 0
      X = df[preds].values
      y = df[target].values
      non_df = {}
      rmse_list = []
      for train_index, test_index in splits.split(X):
          X_train = X[train_index]
          y_train = y[train_index]
          X_test = X[test_index]
          y_test = y[test_index]
          if verbose == 1:
              print(
                  "Iteration %d: Total Observations = %d"
                  % (index, len(X_train) + len(X_test))
              )
              print(
                  "    Training Index %d Observations: %s"
                  % (len(train_index), train_index)
              )
              print(
                  "    Testing Index %d Observations: %s"
                  % (len(test_index), test_index)
              )
          model.fit(X_train, y_train)
          # TODO: Check print_rmse is not defined or loaded
          rmse = print_rmse(y_test, model.predict(X_test))
          rmse_list.append(rmse)
          norm_rmse = rmse / y_test.std()
          print("     Split %d: Normalized RMSE = %0.2f" % (norm_rmse))
          non_df[index] = norm_rmse
          index += 1
      non_df = pd.Series(non_df)
      non_df.plot()
      ave_norm_rmse = np.mean(rmse_list) / y.std()
      print(
          "Normalized RMSE over  entire data after %d splits = 0.2f"
          % (index, ave_norm_rmse)
      )
      return ave_norm_rmse
  
file_path: Auto_TS/auto_ts/utils/val.py
imports: import numpy
  import pandas
  import matplotlib.pyplot
  import seaborn
  from sklearn.model_selection import TimeSeriesSplit
  from sklearn.model_selection import GridSearchCV
  import pdb
label_desc: Use image node_id 1 for calling a global function with example usage: cross_validation_time_series(model, df, preds, target, n_times, verbose) and returns: ave_norm_rmse