Loading data for timeseries forecasting is not trivial - in particular if covariates are included and values are missing. PyTorch Forecasting provides the TimeSeriesDataSet which comes with a to_dataloader() method to convert it to a dataloader and a from_dataset() method to create, e.g. a validation or test dataset from a training dataset using the same label encoders and data normalization.
TimeSeriesDataSet
to_dataloader()
from_dataset()
Further, timeseries have to be (almost always) normalized for a neural network to learn efficiently. PyTorch Forecasting provides multiple such target normalizers (some of which can also be used for normalizing covariates).
See the API documentation for further details on available data encoders and the TimeSeriesDataSet:
pytorch_forecasting.data
Datasets, etc.