class_docstr: Class for the purpose of preprocessing time series.
  
  The method make_features needs to be custom-made by inherited classes.
class_docstr_tok: ["Class","for","the","purpose","of","preprocessing","time","series",".","The","method","make_features","needs","to","be","custom-made","by","inherited","classes","."]
docstr: Parameters
  ----------
  context_window_size: int
  forecast_horizon: int
  stratify_targets: bool
      If False, each context window translates to one data point in
      feature_data of length the number of features, and one
      datapoint in target_data of length the forecast horizon.
      horizon.
      If True, each context window translates to forecast_horizon
      many datapoints. The resulting datapoints in feature_data are
      of length the number of features plus one, where the last
      coordinate varies between 0 and forecast_horizon - 1, and the
      other coordinates fixed. The respective datapoints in
      target_data are all of length 1 and vary between the first to
      the last targets in the forecast horizon. (Hence the name,
      this stratifies the targets.)
  n_ignore_last: int
      Cut the last n_ignore_last steps of the time series.
  max_n_datapts: int
      Maximal number of context windows to sample from the entire
      dataset.
  seed: int
      seed for sampling context windows.
docstr_tok: ["Parameters","--","--","--","--","--","context_window_size",":","int","forecast_horizon",":","int","stratify_targets",":","bool","If","False",",","each","context","window","translates","to","one","data","point","in","feature_data","of","length","the","number","of","features",",","and","one","datapoint","in","target_data","of","length","the","forecast","horizon",".","horizon",".","If","True",",","each","context","window","translates","to","forecast_horizon","many","datapoints",".","The","resulting","datapoints","in","feature_data","are","of","length","the","number","of","features","plus","one",",","where","the","last","coordinate","varies","between","0","and","forecast_horizon","-","1",",","and","the","other","coordinates","fixed",".","The","respective","datapoints","in","target_data","are","all","of","length","1","and","vary","between","the","first","to","the","last","targets","in","the","forecast","horizon",".","(","Hence","the","name",",","this","stratifies","the","targets",".",")","n_ignore_last",":","int","Cut","the","last","n_ignore_last","steps","of","the","time","series",".","max_n_datapts",":","int","Maximal","number","of","context","windows","to","sample","from","the","entire","dataset",".","seed",":","int","seed","for","sampling","context","windows","."]
code: def __init__(
      self,
      context_window_size: int,
      forecast_horizon: int = 1,
      stratify_targets: bool = False,
      n_ignore_last: int = 0,
      max_n_datapts: int = 400000,
      seed: Optional[int] = None,
      num_samples: Optional[int] = None,
      **kwargs,
  ):
      """
      Parameters
      ----------
      context_window_size: int
      forecast_horizon: int
      stratify_targets: bool
          If False, each context window translates to one data point in
          feature_data of length the number of features, and one
          datapoint in target_data of length the forecast horizon.
          horizon.
          If True, each context window translates to forecast_horizon
          many datapoints. The resulting datapoints in feature_data are
          of length the number of features plus one, where the last
          coordinate varies between 0 and forecast_horizon - 1, and the
          other coordinates fixed. The respective datapoints in
          target_data are all of length 1 and vary between the first to
          the last targets in the forecast horizon. (Hence the name,
          this stratifies the targets.)
      n_ignore_last: int
          Cut the last n_ignore_last steps of the time series.
      max_n_datapts: int
          Maximal number of context windows to sample from the entire
          dataset.
      seed: int
          seed for sampling context windows.
      """
      assert not (stratify_targets and (forecast_horizon == 1))
      self.context_window_size = context_window_size
      self.forecast_horizon = forecast_horizon
      self.stratify_targets = stratify_targets
      self.n_ignore_last = n_ignore_last
      self.max_n_datapts = max_n_datapts
      self.kwargs = kwargs
      self.num_samples = num_samples
      self.feature_data: Optional[list] = None
      self.target_data: Optional[list] = None
      if seed is not None:
          np.random.seed(seed)
  
imports: import concurrent.futures
  import logging
  from enum import Enum
  from itertools import chain, starmap
  from typing import Dict, List, Tuple, Union, Optional, Sequence
  import numpy
  from gluonts.core.component import validated
label_desc: Use image node_id 1 to create a new PreprocessGeneric object  with example: obj = PreprocessGeneric(context_window_size, forecast_horizon, stratify_targets, n_ignore_last, max_n_datapts, seed, num_samples)