1.10.0
βοΈ Patch 1.10.0 β Forecasts + Plenty 1:1 order economics¶
π Summary¶
New service_forecast (port 8008) delivers 30-day CPU-only hierarchical sales forecasts for Plenty and Amazon, plus Ops accuracy (MAPE / avg offset), optional Optuna tuning, and product OOS / stockout projections.
Dashboard β Forecast (/forecast): Plenty / Amazon charts, OOS explorer, Ops (MAPE, MAE, Avg offset too high/low, Fill MAPE, Tune params).
Also fixes Plenty 1:1 bundle sell allocation: same-qty aliases (e.g. SKU + SKU(2) both qty 6) copy the peer unit price β they must not divide by qty (that produced phantom β¬11 sells and ββ¬198 line profits while total_order_profit stayed correct).
This release supersedes the draft 1.9.4 note β ship as 1.10.0.
β¨ Details¶
| Area | Behavior |
|---|---|
| Grains (Plenty) | platform β channel (origin) β product (asin_sku Γ origin Γ ship-to) |
| Grains (Amazon) | platform β marketplace β product (ASIN/SKU Γ marketplace); cancelled orders excluded |
| Metrics | Independent models: units, distinct orders, revenue, profit |
| Training | mlforecast + LightGBM; lags 1/2/3/7/14/21/28 + rolling means; DOW seasonal blend; cold-start filter |
| Persistence | Live 30-day horizon; lock in past ds for vs-actual; supersede future ds; prune > FORECAST_RETAIN_HISTORY_DAYS (default 365) |
| Cron | Default 0 4 * * * Europe/Berlin; manual POST /api/v1/forecast/run |
| Ops / MAPE | forecast_accuracy_daily; chips MAPE / MAE / Avg offset (+% Β· too high/low); walk-forward Fill MAPE from history (qty + orders) |
| Optuna HPO | Optional (not nightly); POST /hpo or Ops Tune params; forecast_hpo_params; bounded search + variance penalty |
| OOS | Stock from repricer_articles vs product forecast_qty; OOS date / candidates UI |
| Plenty 1:1 | Same-qty MainβMain(2): copy unit sell; value pack (peer qtyβ1, zero qty=N) still Γ·N; align buy/fee/profit on matching sells |
| Docker | service-forecast in compose / Portainer / Hetzner HTTPS |
π Notes¶
- Apply DDL on existing Postgres (or rely on
create_allon startup): docker/postgres/updates/sales_forecast_tables.sqldocker/postgres/updates/forecast_accuracy_daily.sqldocker/postgres/updates/forecast_hpo_params.sql- NPM: proxy
/api/v1/forecastβservice-forecast:8008. - Frontend:
VITE_FORECAST_API_URL=/api/v1/forecast. - HPO needs order history only (not existing forecast rows). Use space-separated
FORECAST_HPO_METRICS=qty ordersin compose (unquoted commas get truncated). - Re-import affected Plenty order ranges after deploy so 1:1 economics refresh.
- Docs: Forecast, How predictions work, Ops tab, Profit / Plenty bundles.
Returns / refund expenses / fee-load models remain phase 2.