An ensemble of XGBoost, LightGBM, and Random Forest forecasting daily sales quantity for 20,000+ SKUs across five product categories, trained on 2+ years of transaction history with 24 base features (+6 auto-discovered) including promotions.
Three machine-learning models — two gradient boosting, one bagging ensemble — plus a seasonal-naïve baseline. The tree models share the same 24 base + 6 auto-discovered features and use recursive multi-step forecasting over the 46-day horizon. Final submission uses the mean of the three.
Gradient boosted trees with leaf-wise growth and GOSS sampling. At each round a new tree fits the residual gradient, iteratively correcting prior mistakes. Fast on large datasets with sparse features.
Gradient boosted trees with level-wise growth and second-order Taylor approximation of the loss. Regularisation via L1/L2 penalties on leaf weights prevents overfitting on noisy SKU-level signals.
Bagging ensemble: each tree is trained on a bootstrap sample with random feature subsets, then predictions are averaged. Uncorrelated errors across trees reduce variance as 1/B.
Fast day-of-week baseline. For each forecast day it blends the most recent value on that weekday with the 4-week day-of-week mean — capturing weekly seasonality with zero training. Serves as the benchmark all models beat.
Simple mean of the three tree models — LightGBM, XGBoost, and Random Forest. Mixing two boosting variants with bagging diversifies error sources — when errors are uncorrelated, ensemble variance ∝ 1/K.
Tree models use 24 hand-crafted base features plus 6 auto-discovered features (from a 10,000-feature FunSearch pool) = 30. The seasonal-naïve baseline uses only the raw time series.
| Feature group | LightGBM | XGBoost | Rand. Forest | Seas. Naïve |
|---|---|---|---|---|
| Lag features (lag_1–28) · 7 | ✓ | ✓ | ✓ | — |
| Rolling means (roll7/14/28) · 3 | ✓ | ✓ | ✓ | — |
| Calendar (dow, dom, month) · 3 | ✓ | ✓ | ✓ | implicit |
| Promotion flags · 8 | ✓ | ✓ | ✓ | — |
| Category signal (cat_lag1/roll7) · 2 | ✓ | ✓ | ✓ | — |
| SKU identity (sku_id) · 1 | ✓ | ✓ | ✓ | — |
| Auto-discovered (FunSearch) · 6 from 10,000 candidates | ✓ | ✓ | ✓ | — |
| Total features | 30 | 30 | 30 | 1 (series) |
Can a machine discover better features than the hand-crafted 24? We ran a FunSearch study on a 2,000-SKU sample with a library of up to 10,000 auto-generated candidate features, searched three ways: a genetic algorithm over feature-sets, an LLM-in-the-loop sampler (Kimi), and a feature-level genetic program that kills weak features and breeds survivors via crossover & mutation.
The single Kimi-discovered 6-feature set added to base-24, evaluated on every model · per-category & overall FA · 4 validation weeks (2025-06-03 → 06-30), train cutoff 2025-06-02
8802 Category A · 8803 Category B · 8804 Category C · 8805 Hardest · 8807 Category E · Overall = sales-weighted across all five
| Model | 8802 | 8803 | 8804 | 8805 | 8807 | Overall | Lift |
|---|---|---|---|---|---|---|---|
| LightGBM | 79.1% | 81.4% | 62.0% | 47.0% | 63.8% | 67.25% | +1.72 pp |
| XGBoost | 74.1% | 78.7% | 58.5% | 45.0% | 60.5% | 63.62% | +0.71 pp |
| Random Forest | 77.8% | 78.6% | 55.5% | 40.1% | 61.9% | 63.25% | +0.16 pp |
| OLS (Ridge) | 45.3% | 45.4% | 44.7% | 27.0% | 44.3% | 42.54% | +26.70 pp |
The exact add_features() the LLM-in-the-loop sampler
(Kimi, 30 iterations) produced at its best iteration — a momentum + category-relative +
volatility mix it discovered on its own:
The independent genetic search over the feature library reached a comparable +2.46 pp with the same feature families (dispersion · recency · trend) — two different methods converging to the same ceiling confirms the limit is the problem, not the search.
Ceiling insight: the symmetric weekly FA on intermittent retail demand is dominated by weekly seasonality the base lags already capture — limiting feature-engineering headroom.
F = weekly forecast total · A = weekly actual total (per SKU per store)
Weighted aggregation (3 steps):
POC categories (store 常兴天虹00110)
Upload the forecast submission file or load demo data to visualise daily SKU-level forecasts across all five models.
uvicorn api_server:app --port 8000 for live multi-model predictions
Upload your actual sales file. The FA metric is computed in-browser using the exact POC formula — no data leaves your machine.
Auto-detected columns:
日期 / date ·
条码 / 条形码 / barcode ·
当天全部销售数量 / 销量 / quantity
| Period | Weighted FA | SKUs | Forecast Σ | Actual Σ | Bias |
|---|