Hey guys, I am working on implementing the `MLFore...
# mlforecast
a
Hey guys, I am working on implementing the
MLForecast
library and have arrived at implementing the usage of
PredictionIntervals
- however, I am unsure about the
n_windows
parameters which represents the number of cross-validation windows used to calibrate the intervals. Is there anywhere I can find a more elaborate explanation of this? Also I am trying to find the source code for this implemenation, any one who can point me towards this?
j
Hey. The prediction intervals are generated from scores computed using cross validation.
n_windows
refers to how many iterations of cross validation will be performed (more iterations will yield better estimates but will take more time) and each iteration produces one score for each serie and horizon. When predicting we compute quantiles from these scores and generate the intervals. You can find the code to create the scores here and the interval creation here
a
Thanks for the explanation @José Morales. What data/how much data is used the perform the iterations of cross validation? Also I do not completely understand what you mean with: ... each iteration produces one score for each serie and horizon. When predicting we compute quantiles from these scores and generate the intervals. Is this to be understood so that the implementation in MLForecast uses probalistic forecasting models (so models trained on quantiles) which then are calibrated based on conformity scores? If this does not make sense can you elaborate more on the implementation of the Conformal prediction or point me towards some documentation of the way you've implemented it or similar to how you have implemented it.
j
It uses the cross_validation method, so if you set
n_windows=2,h=10
then it uses the last 20 samples from each serie (10 on the first window and 10 on the second). It doesn't use probabilistic forecasting, the conformity scores are the absolute errors in each of the windows, so the procedure for each window is: • train a model • predict
h
steps ahead • compute the absolute errors with respect to the validation set Then to build the intervals we take the point predictions (mean) and compute the quantiles from [mean - scores | mean + scores]
1
a
Thanks - that clarifies a lot for me!