code: def timeseries_analyzer(
      data: Dict[str, pd.DataFrame],
      dtype_dict: Dict[str, str],
      timeseries_settings: TimeseriesSettings,
      target: str,
  ) -> Dict:
      """
      This module analyzes (pre-processed) time series data and stores a few useful insights used in the rest of Lightwood's pipeline.
  
      :param data: dictionary with the dataset split into train, val, test subsets.
      :param dtype_dict: dictionary with inferred types for every column.
      :param timeseries_settings: A `TimeseriesSettings` object. For more details, check `lightwood.types.TimeseriesSettings`.
      :param target: name of the target column.
  
      The following things are extracted from each time series inside the dataset:
        - group_combinations: all observed combinations of values for the set of `group_by` columns. The length of this list determines how many time series are in the data.
        - deltas: inferred sampling interval
        - ts_naive_residuals: Residuals obtained from the data by a naive forecaster that repeats the last-seen value.
        - ts_naive_mae: Mean residual value obtained from the data by a naive forecaster that repeats the last-seen value.
        - target_normalizers: objects that may normalize the data within any given time series for effective learning. See `lightwood.encoder.time_series.helpers.common` for available choices.
  
      :return: Dictionary with the aforementioned insights and the `TimeseriesSettings` object for future references.
      """  # noqa
      tss = timeseries_settings
      groups = get_ts_groups(data["train"], tss)
      deltas, periods, freqs = get_delta(data["train"], tss)
  
      normalizers = generate_target_group_normalizers(
          data["train"], target, dtype_dict, tss
      )
  
      if dtype_dict[target] in (
          dtype.integer,
          dtype.float,
          dtype.num_tsarray,
      ):
          (
              naive_forecast_residuals,
              scale_factor,
          ) = get_grouped_naive_residuals(data["dev"], target, tss)
          differencers = get_differencers(
              data["train"], target, tss.group_by
          )
      else:
          naive_forecast_residuals, scale_factor = {}, {}
          differencers = {}
  
      return {
          "target_normalizers": normalizers,
          "deltas": deltas,
          "tss": tss,
          "group_combinations": groups,
          "ts_naive_residuals": naive_forecast_residuals,
          "ts_naive_mae": scale_factor,
          "periods": periods,
          "sample_freqs": freqs,
          "stl_transforms": {},  # TODO: remove, or provide from outside as user perhaps
          "differencers": differencers,
      }
  
file_path: lightwood/lightwood/data/timeseries_analyzer.py
imports: from typing import Dict, Tuple, List
  import numpy
  import pandas
  from type_infer.dtype import dtype
  from lightwood.api.types import TimeseriesSettings
  from lightwood.helpers.ts import get_ts_groups, get_delta, Differencer
  from lightwood.encoder.time_series.helpers.common import generate_target_group_normalizers
label_desc: Use image node_id 1 for calling a global function with example usage: timeseries_analyzer(data, dtype_dict, timeseries_settings, target) and returns: dict