|TensorFlow 1 version||View source on GitHub|
Utility class for generating batches of temporal data.
Compat aliases for migration
See Migration guide for more details.
tf.keras.preprocessing.sequence.TimeseriesGenerator( data, targets, length, sampling_rate=1, stride=1, start_index=0, end_index=None, shuffle=False, reverse=False, batch_size=128 )
This class takes in a sequence of data-points gathered at
equal intervals, along with time series parameters such as
stride, length of history, etc., to produce batches for
data: Indexable generator (such as list or Numpy array)
containing consecutive data points (timesteps).
The data should be at 2D, and axis 0 is expected
to be the time dimension.
targets: Targets corresponding to timesteps in
It should have same length as
length: Length of the output sequences (in number of timesteps).
sampling_rate: Period between successive individual timesteps
within sequences. For rate
data[i - length]
are used for create a sample sequence.
stride: Period between successive output sequences.
s, consecutive output samples would
be centered around