  Deep learning approaches are increasingly used to tackle forecasting tasks. A
key factor in the successful application of these methods is a large enough
training sample size, which is not always available. In these scenarios,
synthetic data generation techniques are usually applied to augment the
dataset. Data augmentation is typically applied before fitting a model.
However, these approaches create a single augmented dataset, potentially
limiting their effectiveness. This work introduces OnDAT (On-the-fly Data
Augmentation for Time series) to address this issue by applying data
augmentation during training and validation. Contrary to traditional methods
that create a single, static augmented dataset beforehand, OnDAT performs
augmentation on-the-fly. By generating a new augmented dataset on each
iteration, the model is exposed to a constantly changing augmented data
variations. We hypothesize this process enables a better exploration of the
data space, which reduces the potential for overfitting and improves
forecasting performance. We validated the proposed approach using a
state-of-the-art deep learning forecasting method and 8 benchmark datasets
containing a total of 75797 time series. The experiments suggest that OnDAT
leads to better forecasting performance than a strategy that applies data
augmentation before training as well as a strategy that does not involve data
augmentation. The method and experiments are publicly available.
