Open
Description
- if you refer to documentary of timeseries_dataset_from_array, there is an example similarly like this ( I changed parameter for quickly proof):
data = np.arange(10)
x = data[:-3] # x will be [0, 1, 2, 3, 4, 5, 6]
y = data[3:] # y will be [3, 4, 5, 6, 7, 8, 9]
batch_data = timeseries_dataset_from_array(x, y, 3, 1)
for input, target in batch_data:
print(input, target)
It will create samples like [0, 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5],[4, 5, 6] with labels [3, 4, 5, 6, 7].
However, obviously, it misses samples [5, 6, 7], [6, 7, 8] with lables [8, 9].

The api may expected to have the x, and y with same length, but it will miss some samples.
However, if you feed x with data, and y, the output should be correct.
That means, the example 2 in this api should be changed!!!
