knitr::opts_chunk$set(echo = TRUE)
Right now The Auto-arima predictions work like this: Each time learner$predict(row_ids = ids) is called the model assumes that ids are the timestamps that come directly after the last training instance (N). The forecasts are always done assuming the next step is N+1 and the number of steps is determindes by the length of ids.
Instead of determining the horizon by the length of the testsamples, there should be an argument for this. For learner$predict(row_ids = 10:15, h=3) the following should be done:
check if the timestamp according to row 10 is the consecutive one of the last training instance.
make h = 3 predictions at timestep 10:
| predicted Timestep | Mean_prediction | SE_prediction | other predictions
| -------- |:--------:| ---:|---:|
| 10 | 1 | 0.1 |5 |
| 11 | 2 | 0.2 | 6
| 12 | 3 | 0.3 |7 |
3. update the model for timestep 10 without refitting the parameters.
make h = 3 predictions for timestep 11
and so on
In total, the call learner$predict(row_ids = 10:15, h=3) should produce 6 matrices with each h=3 rows.
Add a new argument h to task\$truth() and learner\$predict_internal() that specifies the horizon, i.e task$truth(row_ids = 10:15, h=4) should get 6 matrices with 4 rows each.
learner\$predict_internal() needs to update the model after the prediction for each row_id.
How do we want to handle the multiple matrices?
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.