pytorch-forecasting
pytorch-forecasting copied to clipboard
How to split the data into train, test, and validation
- PyTorch-Forecasting version: 1.0.0
- PyTorch version: 2.0.1
- Python version: 3.8
- Operating System: Linux
I have data of 17 months, so my time_idx ranges from 0-16. There are total 3664 unique ids in my data. So my data has total rows 62288. I just want to split my data into train, val, and test.
- Train data ranges from 0 to 14 time_idx
- Val data should have 15 time_idx
- Test data should have 16 time_idx
So how would I achieve it from inbuilt class TimeSeriesDataset and inbuilt class method .from_dataset?
You can refer to this example. See Cell 5 where training
and validation
are defined.