I'm working on DeepAR using GluonTS. After I trained a model using the proper method, I got a predictor that i named predictor
. Then, I used this to perform a prediction like in this case:
predictor.predict(
ListDataset([{"start": ..., "target": ...}], freq='120min')
)
I noticed that executing this codes multiple time produces different predictions. I also tryed to set a seed with the function of random module but it didn't work. Do you have ideas? Thanks in advance
DeepAR performs a probabilistic forecasting, so it estimates, during training, the statistical distribution of the time series. Consequently, when you predict a series, it samples a distribution, resulting in your non-determinism.
For reducing the variance in your prediction, you can specify the parameter num_samples
in the method predict
, for indicating the number of times it has to sample the distribution for calculating the mean to return you.