What is financial machine learning?
Financial machine learning is the application of machine learning methods supervised learning (regression, classification), unsupervised learning (clustering, dimensionality reduction, anomaly detection), and reinforcement learning (sequential decision-making under uncertainty) to financial prediction, classification, and decision problems. The defining methodological constraint is that financial data are serially correlated, not independently and identically distributed, which means that the standard machine learning toolkit which assumes IID samples must be substantially adapted. The dominant practitioner reference is López de Prado (2018).
The defining problem of financial machine learning is the absence of a large labelled data set. In typical machine learning applications (image classification, speech recognition, language modelling), the labelled data set is measured in millions or billions of examples. In financial machine learning, the labelled data set is typically measured in thousands of examples (one per asset per day for a few decades), and the signal-to-noise ratio is small. The combination of small sample size and low signal-to-noise ratio means that the standard machine learning toolkit, which assumes a large sample, overfits catastrophically in finance. The financial machine learning toolkit is the set of adaptations that prevent overfitting in this setting (López de Prado, 2018).
The defining opportunity of financial machine learning is the richness of the data. The financial markets produce continuous time-series data at high frequency, with rich cross-sectional and temporal structure, and the data set is freely available. The opportunity is to extract signal from the data at a scale and resolution that was not possible before the modern machine learning era. The honest practitioner approaches the opportunity with the discipline of the financial research tradition: every model is hypothesis-driven, every model is validated out-of-sample, and every model is held to the standard that the in-sample performance must be replicated in the out-of-sample period. The dominant reference for the methodological discipline is Harvey, Liu & Zhu (2016), which establishes the multiple-testing correction for the standard finance literature.
What are the dominant supervised learning methods?
The dominant supervised learning methods in financial machine learning are: linear models (OLS regression, ridge regression, LASSO, elastic net), which remain the workhorse for cross-sectional prediction; tree-based models (random forests, gradient-boosted trees), which are the workhorse for non-linear prediction with feature importance; and neural networks (multi-layer perceptrons, recurrent networks, transformers), which are increasingly used in time-series and high-dimensional settings. The dominant commercial tool stack is Python (with scikit-learn, XGBoost, LightGBM, PyTorch) on top of pandas, NumPy, and SciPy (López de Prado, 2018).
Linear models remain the workhorse because they are interpretable, fast, and the standard errors are well-understood. The LASSO and elastic net are particularly useful in finance for feature selection: the LASSO's L1 penalty produces sparse weights, which is appropriate for the high-dimensional / low-sample-size regime of financial data. The dominant reference for the use of linear models in finance is Campbell, Lo & MacKinlay (1997).
Tree-based models are the workhorse for non-linear prediction. The dominant model is the gradient-boosted tree (XGBoost, LightGBM), which produces a sequence of shallow trees, each fit to the residual of the previous trees. Gradient-boosted trees handle non-linearities and interactions naturally, and the feature importance is directly interpretable. The dominant reference is Hastie, Tibshirani & Friedman (2009). The application of tree-based models to financial prediction is documented in López de Prado (2018) and in the recent practitioner literature.
What are the dominant unsupervised learning methods?
The dominant unsupervised learning methods in financial machine learning are: dimensionality reduction (principal component analysis, factor analysis, autoencoders), clustering (k-means, hierarchical clustering, density-based clustering), and anomaly detection (isolation forest, one-class SVM, autoencoder-based detection). The dominant commercial use cases are: factor model construction (which is a principal component analysis of the cross-section of asset returns), regime detection (which is a clustering of the time-series of returns into a small number of states), and outlier detection (which is an anomaly detection on the time-series of returns or on the cross-section of features).
Dimensionality reduction is used in finance primarily for factor model construction. The classical factor models (Fama-French, Carhart) are constructed by sorting assets on a candidate factor and computing the long-short return; the modern factor models (Barra, Axioma) are constructed by a principal component analysis of the cross-section of asset returns, with the first few principal components corresponding to the standard risk factors. The autoencoder-based extension of the same idea is to use a non-linear dimensionality reduction, with the latent variables corresponding to the non-linear risk factors. The dominant reference is Hastie, Tibshirani & Friedman (2009).
Regime detection is the time-series analogue: the time-series of returns is clustered into a small number of states (e.g., bull, bear, high-volatility), and the regime is used as a feature in the supervised learning model or as a filter on the trading decision. The dominant models are hidden Markov models (HMMs) for state-space regime detection, change-point detection algorithms for abrupt regime shifts, and rolling-window clustering for more flexible regime definitions. The dominant reference is Hamilton (1989) for HMMs, with the practitioner extension in López de Prado (2018).
What is the data leakage problem?
Data leakage is the single largest source of error in financial machine learning. It is the inadvertent use of information in a model that was not actually available at the simulated decision time. The standard example is the use of end-of-day closing prices to compute features that are then used to make a decision at the open of the next day; the end-of-day close is not known at the open, so the model is using future information. The result is a model that looks excellent in backtest but fails in production. The standard reference for data leakage in finance is López de Prado (2018), which dedicates an entire chapter to the topic.
The principal sources of data leakage in finance are: (1) using the same observation for both training and testing (without proper cross-validation, the same data point appears in both sets and the model learns it), (2) using the same row in two different time periods (without embargo, the rows that are temporally adjacent to a test row leak into the training set), (3) using features that are derived from future information (e.g., using the next-day's volatility to predict today's return), and (4) using features that are derived from data that is not actually available at the decision time (e.g., using the closing price to make a decision at the open, when the close is not yet known).
The state-of-the-art responses are: (1) purged k-fold cross-validation, which removes observations whose labels overlap the test set (López de Prado, 2018), (2) combinatorial purged cross-validation (CPCV), which generates multiple backtest paths and estimates the probability of backtest overfitting (Bailey, Borwein, López de Prado & Zhu, 2014), (3) the embargo, which removes additional samples near the test boundary to account for serial correlation, and (4) the triple-barrier method, which labels each observation by the first of three events touched (upper take-profit, lower stop-loss, vertical time barrier), with a meta-label for the position side. The dominant reference is López de Prado (2018).
What is the cross-validation problem?
Standard k-fold cross-validation is invalid for time-series data. The standard k-fold cross-validation assumes that the data are independently and identically distributed, so the k folds can be drawn randomly from the data set. For time-series data, the random-fold assumption is wrong: observations are temporally correlated, and a random-fold draw will produce folds that overlap in time, which means that the training set will contain observations that are temporally adjacent to the test set, which means that the model will overfit. The overfit is invisible: the in-fold performance looks great, the out-of-fold performance is the real measure, and the gap between them is the overfit gap (López de Prado, 2018).
The purged k-fold cross-validation addresses the leakage problem. In the standard k-fold, observations whose labels overlap the test set are removed from the training set. The overlap is defined by the label horizon: if the label for an observation is the next-day return, then the observation on the day before the test set and the observation on the day after are also removed, because their labels would overlap with the test set. The embargo extends the removal: in addition to the overlapping labels, an embargo of (say) 1% of the data is removed from both sides of the test boundary, to account for serial correlation. The dominant reference is López de Prado (2018).
The combinatorial purged cross-validation (CPCV) extends the purged k-fold to multiple backtest paths. In the CPCV, the data is divided into N groups, and the test set is taken as a single group while the training set is the remaining N-1 groups. This produces N backtest paths (one for each choice of test group). The number of unique paths is C(N, k) where k is the number of groups. The CPCV estimates the probability of backtest overfitting (PBO) as the fraction of paths with negative logit performance. The dominant reference is Bailey, Borwein, López de Prado & Zhu (2014), with the modern treatment in López de Prado (2018).
What are the dominant reinforcement learning methods?
Reinforcement learning (RL) is the third major class of machine learning methods, alongside supervised and unsupervised learning. The defining problem is sequential decision-making under uncertainty: an agent takes an action, observes a reward, transitions to a new state, and must learn a policy that maximises the expected cumulative reward. The dominant algorithms are: Q-learning (Watkins, 1989), SARSA (Rummery & Niranjan, 1994), deep Q-networks (Mnih et al., 2015), policy gradient methods (Williams, 1992; Sutton et al., 2000), and actor-critic methods (Konda & Tsitsiklis, 2000). The dominant commercial application in finance is portfolio optimisation and execution, where the state is the portfolio, the action is the trade, and the reward is the realised return net of costs.
The dominant challenge in financial RL is the overfitting problem. Standard RL methods assume that the agent can interact with the environment arbitrarily many times; in finance, the agent can only trade once in each historical period, and the data set is small. The state-of-the-art response is the use of simulated environments, where the agent is trained on a synthetic price process and then deployed in production; the risk is that the synthetic environment is not a faithful representation of the real market, and the agent overfits to the synthetic environment. The dominant reference is López de Prado (2018) (Section 17 on backtesting on synthetic data).
The dominant practitioner use case for RL in finance is execution. The execution algorithm is the agent; the state is the order book and the trading day; the action is the child order; the reward is the realised execution price minus the benchmark (the implementation shortfall). The agent learns a policy that minimises the implementation shortfall net of the market impact. The state-of-the-art execution algorithms are based on the Almgren-Chriss framework, with the RL extension providing an adaptive policy that responds to the realised market conditions. The dominant reference is Almgren & Chriss (2000) (Hull, 2017).
What is the deployment workflow?
The deployment workflow for a financial machine learning model is the standard sequence of stages: training, validation, paper trading, live trading, and ongoing monitoring. The training stage produces a model on the training data. The validation stage produces an estimate of the out-of-sample performance, using the purged k-fold cross-validation or CPCV. The paper trading stage runs the model in production with no real money, for at least several months, to confirm that the data feed, the execution, and the real-time behaviour are consistent with the validation. The live trading stage runs the model with real money, starting with a small allocation and increasing as the live track record is established. The ongoing monitoring stage tracks the model's performance against the validation, with automatic shutdown if the live performance degrades below a threshold (López de Prado, 2018).
The dominant deployment infrastructure in modern quant firms is: the model is serialised (typically as a Python pickle or an ONNX file), loaded into a serving system (typically a Flask or FastAPI service), and called from the trading system. The serving system is monitored for latency (the model must produce a forecast within the latency budget of the trading system), for errors (any exception in the serving system is logged and triggers a fallback to a simpler model), and for input drift (the distribution of the input features is monitored against the training distribution, and the model is retrained if the drift exceeds a threshold).
The dominant post-deployment concern is model decay. The model's out-of-sample performance will degrade over time, for three reasons: the model's signal is being arbitraged away (as other market participants discover and trade on the same signal), the market regime has changed (the model was trained on one regime and is now in another), or the data feed has changed (the data is now different from the data the model was trained on). The state-of-the-art response is continuous monitoring of the model's live performance, with automatic retraining when the live performance degrades below a threshold. The dominant reference is López de Prado (2018), with the modern treatment of decay monitoring in the production ML literature.
What are the honest limits of financial machine learning?
The honest limits of financial machine learning are the same as the honest limits of any model-based discipline. The defining limit is data scarcity: financial data are small by machine-learning standards, and the signal-to-noise ratio is small. The standard response larger models with more parameters, trained on more data does not work in finance, because the data is not available and the larger models overfit more. The state-of-the-art response is: smaller models, fewer features, more data engineering, more rigorous out-of-sample validation (López de Prado, 2018).
The second limit is non-stationarity. The statistical properties of financial returns change over time, in ways that are not always predictable. A model that is fit on a single historical regime will not survive a regime change. The standard response is continuous monitoring and retraining, with the model retrained when the live performance degrades below a threshold. The dominant reference is the production ML literature, with the financial application in López de Prado (2018).
The third limit is the human. Financial machine learning is a discipline of judgement. The model's output is the input to the trader's decision, not the decision itself. The most common single source of major losses in the financial machine learning function is a known model risk that was not managed, a known data leakage that was not addressed, or a known model that was overridden. The honest practitioner treats the model as a tool, not as an oracle, and uses the model to make better decisions, not to replace the decision (López de Prado, 2018).