Setup
When ML Is Appropriate in Quant Finance
Machine learning is appropriate when the relationship between features and returns is:
- Non-linear or high-dimensional — beyond what OLS factor regression can model.
- Latent — the relevant features are not immediately obvious but can be extracted from raw data.
- Sufficiently stable — the relationship persists long enough to be exploited after accounting for transaction costs.
The word "signal" in quantitative finance refers to a predictive variable — a feature or combination of features — whose value at time predicts the cross-sectional or time-series return at time for horizon . The quality of a signal is measured by its information coefficient (IC):
where is the model's predicted return and is the realised return. An IC of 0.05 is considered actionable at scale; 0.10 is strong.
Conventions. All features are point-in-time — constructed from data available strictly before the forecast period to avoid look-ahead bias. Returns are cross-sectionally demeaned and winsorised (e.g., at ±3 standard deviations) before model fitting to reduce outlier impact. All features are standardised (zero mean, unit variance) within each cross-sectional rebalancing date.
Theory
1. The Feature Engineering Framework
Feature engineering converts raw financial data into predictive inputs. Categories:
| Feature Type | Examples | Rationale |
|---|---|---|
| Momentum | 1-month, 6-month, 12-month returns; return reversals | Trend persistence; short-term reversal |
| Value | Book-to-market, earnings yield, free cash flow yield | Mean-reversion to fundamentals |
| Quality | ROE, gross profitability, accruals | Persistent mispricing of quality |
| Low risk | Idiosyncratic vol, beta, max drawdown | Low-volatility anomaly |
| Technical | RSI, moving average crossovers, volume ratios | Short-term supply/demand signals |
| Alternative | Sentiment from news/filings, satellite data | Unstructured data signals |
Winsorisation is critical: return distributions have fat tails. Winsorise each feature at time by: then cross-sectionally standardise: .
2. Regularised Linear Models
Standard OLS collapses with many features (multicollinearity, overfitting). Regularisation constrains the coefficient vector:
Ridge regression ( regularisation):
Ridge shrinks all coefficients toward zero proportionally. The closed-form inverse exists even when is singular. Optimal selected by purged cross-validation (see §3).
Lasso ( regularisation):
Lasso produces sparse solutions — many exactly — performing implicit feature selection. No closed form; solved via coordinate descent or LARS algorithm. Useful when only a few features are believed to be genuinely predictive.
Elastic Net combines both:
3. Gradient Boosted Trees
For non-linear feature interactions, gradient boosted decision trees (GBM/XGBoost/LightGBM) are the dominant approach in quant equity signal research.
Gradient boosting algorithm. Fit an additive model , where is a regression tree fit to the pseudo-residuals . For squared loss , pseudo-residuals equal ordinary residuals. Learning rate controls step size; smaller + more trees reduces overfitting.
Key regularisation parameters:
max_depth: maximum depth of each tree (2–4 recommended for financial data)n_estimators: number of treeslearning_rate: typically 0.01–0.05min_samples_leaf: minimum samples per leaf node (controls overfit)subsample: fraction of samples used per tree (stochastic gradient boosting)
Feature importance is computed as total reduction in the objective function attributable to each feature across all splits (impurity-based) or via permutation importance (model-agnostic, more reliable for correlated features).
4. Purged Walk-Forward Cross-Validation
Standard -fold cross-validation is invalid for time series because:
- Data leakage through time: test folds occur before training folds — information from the future is used to build the model.
- Overlapping returns: if the label is a 5-day forward return, consecutive observations share 4 days of return data. Validation scores overstate out-of-sample predictability.
Purged walk-forward CV (López de Prado 2018):
For each fold :
- Train on observations .
- Purge the most recent training observations that overlap with the test period in their label window: remove observations .
- Optionally add an embargo of periods after the test set to prevent leakage via microstructure effects.
- Test on .