I was reading the blog post on multivariate time-series, and was confused by the snippet of code pasted below:
from gluonts.dataset.multivariate_grouper import MultivariateGrouper
num_of_variates = len(train_dataset)
train_grouper = MultivariateGrouper(max_target_dim=num_of_variates)
test_grouper = MultivariateGrouper(
max_target_dim=num_of_variates,
num_test_dates=len(test_dataset) // num_of_variates, # number of rolling test windows
)
multi_variate_train_dataset = train_grouper(train_dataset)
multi_variate_test_dataset = test_grouper(test_dataset)
Why is the num_test_dates = len(test_dataset) // num_of_variates
? The length of the test_dataset and num_variates are both the same, they correspond to the number of entries in the dataset, not the number of entries in the target series. In this case num_test_dates=1
which I think is correct because the validation and test sets are one prediction_length
longer than the train and validation sets, respectively, but I don’t see the connection to the number of variates.
Thanks for any help!