The rolling_window_sequences primitive is not allowing a target_size of 0, in which case an out-of-bounds error will be raised for the line y_index.append(index[end]).
The reason is the way we iterate over the arrays, where in the last iteration end is equal to len(index).
However, it would be quite useful to specify target_size=0 in cases where we do not have targets/predictions, but rather only want to create rolling input windows. (Examples would be the CycleGAN primitive or any other reconstruction based models like Autoencoder).
One potential solution would be to check if target_size>0.
...
out_X.append(X[start:end])
X_index.append(index[start])
if target_size>0:
out_y.append(target[end:end + target_size])
y_index.append(index[end])
...
This way we would return an empty arrays for the target values and target index if target_size=0.
The
rolling_window_sequences
primitive is not allowing atarget_size
of 0, in which case an out-of-bounds error will be raised for the liney_index.append(index[end])
. The reason is the way we iterate over the arrays, where in the last iterationend
is equal tolen(index)
.However, it would be quite useful to specify
target_size=0
in cases where we do not have targets/predictions, but rather only want to create rolling input windows. (Examples would be the CycleGAN primitive or any other reconstruction based models like Autoencoder).One potential solution would be to check if
target_size>0
.This way we would return an empty arrays for the target values and target index if
target_size=0
.