A machine learning pipeline for predicting next-day asset allocation returns, built for the QRT challenge. The approach follows Lopez de Prado's Advances in Financial Machine Learning methodology to build a model with minimal data leakage.
Given a 20-day history of returns (RET_1–RET_20) and signed volumes (SIGNED_VOLUME_1–SIGNED_VOLUME_20) for each asset allocation, predict the sign of the next-day return. Evaluation metric: binary classification accuracy.
A minimal two-model benchmark establishing the ~52% accuracy floor:
- Features: Rolling return means (
AVERAGE_PERF_{3,5,10,15,20}), group-level averages (ALLOCATIONS_AVERAGE_PERF_*), rolling std — ~45 features total - Ridge regression: α=1.0, trained on full set → 52.18% train accuracy
- LightGBM: 8-fold CV (shuffle=True),
max_depth=3, 500 rounds → 52.22% ± 0.20% mean OOS accuracy
| Category | Features |
|---|---|
| Benchmark | Rolling return means/std; group-level aggregates |
| Dollar Bar | DOLLAR_VOL_i (ret × vol); VWAP returns over 5/10/20-day windows; cross-sectional volume ranks |
| ETF Trick | Pseudo-NAV (cumulative product), max drawdown, return-per-turnover, Sharpe-per-turnover |
| Group-Level | Intra-group avg/std; relative performance vs. group (REL_PERF_VS_GROUP_i) |
| CUSUM | Structural break detection on returns, dollar volume, and signed volume within each row |
| Fractional Differentiation (FFD) | Stationarity-preserving differencing; optimal order d* found via ADF on 10% of train rows |
| Cross-Sectional | Turnover z-score; volume rank percentiles |
Feature pruning via correlation clustering reduces 140 → ~40 features with no accuracy loss (features_v2).
Three CV schemes applied in parallel to diagnose leakage:
- KFold (n=8, shuffle): Primary training CV on date groups
- Purged + Embargoed CV: AFML Ch.7; embargo grids
[0, 5, 20]days — confirmed no meaningful leakage - GroupKFold (by ALLOCATION): Checks allocation-level overfitting — gap vs. date CV is small (~1% std)
- LightGBM (
objective=mse,max_depth=3,lr=1e-2, 500 rounds): main model, handles NaN natively - Random Forest (
n_estimators=300,criterion=entropy,class_weight=balanced_subsample, OOB scoring): comparison model; hyperparameter-tuned viaRandomizedSearchCV - Feature importance assessed via MDI, MDA, and SFI (AFML Ch.8–9)
| Configuration | Accuracy |
|---|---|
| Baseline LightGBM (benchmark features) | 52.22% ± 0.20% |
| LightGBM | ~52–53% OOS |
| Tuned Random Forest (OOB) | ~53–54% |
Top predictive features: GROUP (regime signal), CUSUM filters, FFD returns, and ALLOCATIONS_AVERAGE_PERF_*.
- The signal is weak (~52%)
- Triple-barrier labeling + volatility-scaled sample weights are the most impactful improvements
- Feature reduction (correlation clustering) preserves accuracy while cutting noise
- GROUP and regime-level features carry the strongest signal; raw return lags contribute least