0 of 9 published · 9 early access — new ones unlock here as they go live.
Unsupervised & RL: The Finale
Collinear predictors, PCA, autoencoders, k-means feature clustering, k-nearest neighbours, Q-learning and policy gradients, why RL struggles in markets, and series wrap-up.
About the Book
Guillaume Coqueret and Tony Guida's Machine Learning for Factor Investing: Python Version (CRC Press, 2023) tests modern machine learning on real cross-sectional equity data without hype. Its single starting premise is modest: future stock returns depend on firm characteristics, through a relationship that is unknown, potentially nonlinear, and time-varying. It deliberately leaves out high-frequency trading, fraud/credit scoring, alternative data, and NLP so every chapter stays anchored to one transparent monthly equity dataset.
This nine-episode series walks through Chapters 1–17 in plain words — skipping line-by-line Python boilerplate to focus on the financial intuition, the math, and the sobering empirical reality checks behind penalized regressions, trees, neural networks, validation, backtesting, interpretability, and reinforcement learning.
Monthly cross-section of firm characteristics & forward returns
Missing values, outliers, cross-sectional scaling & labels
Penalized linear models, trees, neural nets, SVMs & ensembles
Hyperparameter tuning without leaking future regimes
Cross-sectional return forecasts or rank probabilities
Translating signals into long-short or long-only allocations
Turnover, transaction costs, Sharpe & overfitting checks
Intertwined loop — inputs and framing drive every stage
Series Roadmap
| # | Chapters | What it covers | Status |
|---|---|---|---|
| 1 | Ch 1–2, §3.1–3.2, Ch 17 | Foundation: Factors, Anomalies & the ML Workflow The US equity dataset (1,207 stocks, 93 uniformized features), the ML portfolio workflow, why ML is no magic wand, portfolio sorts, classic factors, Fama-MacBeth regressions, and factor competition. | |
| 2 | §3.3–3.5 + Ch 4 | Data Alchemy: Characteristics, Factor Timing & Preprocessing Factors vs. firm characteristics, factor momentum, timing and ESG, linking characteristics to ML, plus missing data, outliers, cross-sectional scaling, labelling, and feature persistence. | |
| 3 | Ch 5 + Ch 9 | Taming the Noise: Penalized Regressions & Bayes Ridge, lasso, and elastic net; sparse hedging for minimum-variance portfolios; predictive regressions; and the Bayesian bridge — priors, MCMC sampling, Bayesian regression, naive Bayes, and BART. | |
| 4 | Ch 6 + Ch 8 | Into the Forest: Tree Methods & SVMs Simple trees, random forests, AdaBoost, XGBoost with monotonicity constraints and DART, completing BART, and support vector machines for classification and regression. | |
| 5 | Ch 7 | Neural Nets: Reality Check Perceptrons, multilayer perceptrons, universal approximation and Barron’s bound, back-propagation, depth vs. sample size, dropout, LSTMs/GRUs, autoencoders, and GANs. | |
| 6 | Ch 10 | Validation & Tuning Regression and classification metrics, ROC/AUC, the bias–variance trade-off, overfitting per model family, grid/random/Bayesian hyperparameter search, and purged backtest validation. | |
| 7 | Ch 11–12 | Ensembles & Backtesting Linear and stacked ensembles, turning predictions into portfolio weights, performance metrics, common backtest errors, non-stationarity, and backtest overfitting. | |
| 8 | Ch 13–14 | Decoding the Black Box: Interpretability & Causality Global and local interpretability (surrogate trees, variable importance, PDP, LIME, Shapley values), Granger vs. Pearl causality, covariate shift, concept drift, and online/transfer learning. | |
| 9 | Ch 15–16 | Unsupervised & RL: The Finale Collinear predictors, PCA, autoencoders, k-means feature clustering, k-nearest neighbours, Q-learning and policy gradients, why RL struggles in markets, and series wrap-up. |
Foundation: Factors, Anomalies & the ML Workflow
One Shared US Equity Dataset
Every algorithm in the book is benchmarked on the same monthly cross-section: 1,207 US-listed stocks (283,380 full rows from November 1998 to March 2019; 268,336 rows in the filtered 2000–2018 working sample), described by 93 features across valuation, profitability and quality, momentum, risk, earnings estimates, and volume/liquidity, paired with forward 1-, 3-, 6-, and 12-month return labels.
Each feature is uniformized separately at every date, and binary classification labels assign 1 when a stock beats that month's cross-sectional median return (keeping classes balanced across both bull runs and crashes).
“Machine Learning Is No Magic Wand”
Coqueret and Guida intentionally leave their baseline models mediocre to drive home a practitioner truth: financial returns are dominated by noise, simple edges get arbitraged away, and by the no-free-lunch theorem, better inputs beat fancier architectures. Echoing Jeff Bezos's question — “What's not going to change?” — persistent economic relationships outlast fragile statistical coincidences.
Linear Factor Models & the Classic Anomalies
Under CAPM, only market beta should explain cross-sectional returns — which is why every extra factor in the Arbitrage Pricing Theory (APT) literature is called an anomaly.
Linear multi-factor model (Equation 3.1)
Small minus big market capitalization
High minus low book-to-market (price-to-book proxy)
Winners minus losers over past 12–1 months
Robust minus weak operating profitability
Conservative minus aggressive asset growth
Betting against beta — low-beta minus high-beta
Detecting Anomalies & the Replication Crisis
How factors are tested
- Portfolio sorts: rank stocks into 2–10 buckets each month and compare top vs. bottom
- Fama-MacBeth two-pass: time-series betas first, cross-sectional risk premia second
- Factor competition: regress each factor on the rest (HML turns redundant in FF 2015)
Why published factors disappoint
- Post-publication decay and crowding via smart-beta ETFs (McLean & Pontiff)
- Harvey’s higher hurdle: demand t-statistics above 3.0, not the classic 2.0
- ~12% publication-bias haircut: a reported 8% annual anomaly is closer to ~7%
In noisy financial markets, inputs, framing, and honest validation matter far more than the model's complexity.