Add urban_meal_delivery.forecasts.models sub-package

- `*Model`s use the `methods.*.predict()` functions to predict demand
  given an order time series generated by `timify.OrderHistory`
- `models.base.ForecastingModelABC` unifies how all `*Model`s work
  and implements a caching strategy
- implement three `*Model`s for tactical forecasting, based on the
  hets, varima, and rtarima models described in the first research paper
- add overall documentation for `urban_meal_delivery.forecasts` package
- move the fixtures in `tests.forecasts.timify.conftest` to
  `tests.forecasts.conftest` and adjust the horizon of the test horizon
  from two to three weeks
This commit is contained in:
Alexander Hess 2021-02-01 20:39:52 +01:00
commit 67cd58cf16
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
12 changed files with 747 additions and 71 deletions

View file

@ -17,8 +17,8 @@ from urban_meal_delivery import config
def good_predict_at():
"""A `predict_at` within `START`-`END` and ...
... a long enough history so that either `train_horizon=1`
or `train_horizon=2` works.
... a long enough history so that either `SHORT_TRAIN_HORIZON`
or `LONG_TRAIN_HORIZON` works.
"""
return datetime.datetime(
test_config.END.year,
@ -33,10 +33,10 @@ def good_predict_at():
def bad_predict_at():
"""A `predict_at` within `START`-`END` but ...
... not a long enough history so that both `train_horizon=1`
and `train_horizon=2` do not work.
... not a long enough history so that both `SHORT_TRAIN_HORIZON`
and `LONG_TRAIN_HORIZON` do not work.
"""
predict_day = test_config.END - datetime.timedelta(weeks=1, days=1)
predict_day = test_config.END - datetime.timedelta(weeks=2, days=1)
return datetime.datetime(
predict_day.year, predict_day.month, predict_day.day, test_config.NOON, 0,
)