Create tactical demand forecasts

- the first notebook runs the tactical-forecasts command
- the second notebook describes the tactical demand forecasting process
  + demand aggregation on a per-pixel level
  + time series generation: horizontal, vertical, and real-time time series
  + STL decomposition into seasonal, trend, and residual components
  + choosing the most promising forecasting model
  + predicting demand with various models
- fix where to re-start the forecasting process after it was interrupted
- enable the heuristic for choosing the most promising model
  to also work for 7 training weeks
This commit is contained in:
Alexander Hess 2021-02-04 23:41:21 +01:00
commit 9d6de9d98c
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
5 changed files with 3480 additions and 4 deletions

View file

@ -105,7 +105,12 @@ def tactical_heuristic( # noqa:C901,WPS213,WPS216,WPS231
# Continue with forecasting on the day the last prediction was made ...
last_predict_at = ( # noqa:ECE001
db.session.query(func.max(db.Forecast.start_at))
.join(db.Pixel, db.Forecast.pixel_id == db.Pixel.id)
.join(db.Grid, db.Pixel.grid_id == db.Grid.id)
.filter(db.Forecast.pixel == pixel)
.filter(db.Grid.side_length == side_length)
.filter(db.Forecast.time_step == time_step)
.filter(db.Forecast.train_horizon == train_horizon)
.first()
)[0]
# ... or start `train_horizon` weeks after the first `Order`