code: def time_series_data():
      """Generate some timeseris data which is useful for testing ML models.
      We do not only rely on functions in ``greykite.common.testing_utils``
      This function includes some operations which are not necessary in general:
      e.g. (a) adding many random features (b) including a large number of fourier terms
      in the features."""
      np.random.seed(1317)
  
      data_size = 600
      train_size = 500
      date_list = pd.date_range(
          start="2010-01-01", periods=data_size, freq="D"
      ).tolist()
      time_col = "ts"
      df0 = pd.DataFrame({time_col: date_list})
      time_df = build_time_features_df(
          dt=df0[time_col], conti_year_origin=2010
      )
  
      df = pd.concat([df0, time_df], axis=1)
      df["growth"] = 0.5 * (df[TimeFeaturesEnum.ct1.value] ** 1.05)
  
      # We generate a large number of Fourier terms (useful to see if regularization works)
      func = fourier_series_multi_fcn(
          col_names=[
              TimeFeaturesEnum.toy.value,
              TimeFeaturesEnum.tow.value,
              TimeFeaturesEnum.tod.value,
          ],
          periods=[1.0, 7.0, 24.0],
          orders=[50, 30, 30],
          seas_names=None,
      )
  
      res = func(df)
      df_seas = res["df"]
      df = pd.concat([df, df_seas], axis=1)
  
      fs_coefs = [-1, 3, 4]
      intercept = 3.0
      noise_std = 0.1
  
      df["y"] = abs(
          intercept
          + df["growth"]
          + fs_coefs[0]
          * df[
              get_fourier_col_name(
                  1, TimeFeaturesEnum.tod.value, function_name="sin"
              )
          ]
          + fs_coefs[1]
          * df[
              get_fourier_col_name(
                  1, TimeFeaturesEnum.tow.value, function_name="sin"
              )
          ]
          + fs_coefs[2]
          * df[
              get_fourier_col_name(
                  1, TimeFeaturesEnum.toy.value, function_name="sin"
              )
          ]
          + noise_std * np.random.normal(size=df.shape[0])
      )
  
      # Adds 100 variables without predictive power (randomly generated)
      for i in range(100):
          df[f"x{i}"] = np.random.normal(size=len(df))
  
      feature_cols = (
          ["growth"]
          + list(df_seas.columns)
          + [f"x{i}" for i in range(100)]
      )
  
      # Defines train and test sets
      x_train = df[feature_cols][:train_size]
      y_train = df["y"][:train_size]
  
      x_test = df[feature_cols][train_size:]
      y_test = df["y"][train_size:]
  
      df_train = df[:train_size]
      df_test = df[train_size:]
  
      return {
          "df": df,
          "df_train": df_train,
          "df_test": df_test,
          "x_train": x_train,
          "y_train": y_train,
          "x_test": x_test,
          "y_test": y_test,
          "feature_cols": feature_cols,
      }
  
imports: import warnings
  import numpy
  import pandas
  import pytest
  import scipy
  from pandas.testing import assert_frame_equal
  from patsy import dmatrices
  from greykite.algo.common.ml_models import breakdown_regression_based_prediction
  from greykite.algo.common.ml_models import design_mat_from_formula
  from greykite.algo.common.ml_models import fit_ml_model
  from greykite.algo.common.ml_models import fit_ml_model_with_evaluation
  from greykite.algo.common.ml_models import fit_model_via_design_matrix
  from greykite.algo.common.ml_models import get_h_mat
  from greykite.algo.common.ml_models import get_intercept_col_from_design_mat
  from greykite.algo.common.ml_models import predict_ml
  from greykite.algo.common.ml_models import predict_ml_with_uncertainty
  from greykite.algo.uncertainty.conditional.conf_interval import predict_ci
  from greykite.common.constants import ERR_STD_COL
  from greykite.common.constants import QUANTILE_SUMMARY_COL
  from greykite.common.constants import TimeFeaturesEnum
  from greykite.common.evaluation import EvaluationMetricEnum
  from greykite.common.evaluation import calc_pred_err
  from greykite.common.features.timeseries_features import build_time_features_df
  from greykite.common.features.timeseries_features import fourier_series_multi_fcn
  from greykite.common.features.timeseries_features import get_fourier_col_name
  from greykite.common.python_utils import assert_equal
  from greykite.common.testing_utils import gen_sliced_df
label_desc: Use image node_id 3 for calling a global function with example usage: time_series_data() and returns: dict