Create Data for Recurrent Networks

Module

prosper_nn.utils.generate_time_series_data.sample_data(sample_size: int, n_features_Y: int, n_features_U: int, signal_freq: int = 10) Tuple[Tensor, Tensor][source]

Creates dummy time series with targets and exogenous data. Adaption from https://github.com/uselessskills/hcnn

Parameters:
  • sample_size (int) – The total length of the created time series.

  • n_features_Y (int) – The number of target variables that should be created.

  • n_features_U (int) – The number of exogenous features.

  • signal_freq (int) – A number to set the frequence of the timeseries. Higher number creates more complex time series.

Returns:

  • Y (torch.Tensor) – Created targets for time series with shape=(sample_size, n_features_Y).

  • U (torch.Tensor) – Created exogenous features with shape=(sample_size, n_features_U).

Example

>>> Y, U = sample_data(100, 1, 3)
>>> print(Y.shape)
>>> print(U.shape)
torch.Size([100, 1])
torch.Size([100, 3])