Basic Prerequisites: 04 · Gradient Boosting and Low-SNR Problem.
1. Intuition & Practical Objective
Trees and boosters are maximally flexible function approximators, and finance is a maximally low-SNR domain. That combination is dangerous: given enough depth, boosting rounds, or candidate features, a tree ensemble will drive training error toward zero on data that contains almost no signal. This page names the specific ways tree methods go wrong in finance - not as general ML caution but as concrete, measurable traps - and gives the discipline (validation, importance, selection) that keeps them honest.
The five traps, in one line each:
- Unbounded depth memorizes noise (train MSE falls forever, test MSE turns up).
- MDI is in-sample and cardinality-biased - a pure-noise feature scores high.
- MDA under correlated features is a substitution trap - near-duplicates cancel each other’s importance.
- Feature selection before the CV split is leakage - a phantom edge appears on pure noise.
- Hyperparameter tuning on the wrong CV is overfitting twice - AFML’s purged grid search exists for exactly this.
2. Mathematical Ground Truth & Derivations
A. The overfitting identity. For a model fit on points with effective parameters, training optimism is (ESL 7.24). A grown tree’s effective scales with its number of leaves , so a full tree has and its training error is optimistically low by construction. In finance dwarfs the signal, so any split that reduces training SSE is almost certainly fitting noise; the only protection is an out-of-sample criterion for depth//.
B. MDI, formally (ESL 10.42–10.43). For a tree with internal node using variable and impurity decrease ,
MDI is computed in-sample and, given enough nodes, every feature - including pure noise - receives positive importance. It is also biased toward variables that offer many split points (high cardinality / continuous), because more candidate thresholds means a higher chance of a lucky impurity drop (AFML §8.3.1, Strobl et al. 2007; White & Liu 1994). MDI is a description of the fitted tree, not evidence of predictive power.
C. MDA / permutation importance. Fit, score on held-out data, then permute column and re-score:
MDA is out-of-sample (so it can honestly declare all features useless), but it inherits substitution effects: with two near-identical features, permuting one leaves the other to carry the signal, so both can look small. The remedy is clustered permutations (permute correlated groups together) or orthogonalised features (PCA), AFML §8.3.2.
D. Hyperparameter discipline (AFML Ch 9). Tuning is itself a fit. Grid/randomised search must run on a purged, embargoed CV generator (PurgedKFold), else the search optimises against leaked information and the selected hyperparameters fail live. Scoring should be a proper loss (the paper argues for negative log-loss over accuracy) because accuracy is insensitive to confidence and hides overfitting.
3. Computational Implementation - the traps in numbers
Trap 1 - MDI rewards pure noise. Target depends only on a binary feature; a continuous feature is pure noise. A fully-grown tree nonetheless assigns it large MDI.
Trap 1 result: the pure-noise continuous feature claims MDI against for the genuinely informative binary feature. Had we ranked features by MDI and dropped the bottom, we would have been ranking noise against signal. Trap 4 result: on data with zero true signal, screening features on the whole sample and then cross-validating them yields a positive of ; screening inside each training fold honestly returns (correctly, no signal). The leaky pipeline manufactures an edge from nothing - the exact failure that ships as “alpha” and dies live.
4. Failure Modes & First-Principles Breakdowns (numbered)
- Unbounded depth / too many rounds. Train error falls monotonically; test error has a minimum. In low SNR that minimum is shallow (depth 2–4, few hundred trees) and must be found out-of-sample.
- MDI as a selection criterion is invalid. It is in-sample and biased toward high-cardinality features. Use it only to describe a fitted tree; use MDA/permutation (with clustered or orthogonalised features) for selection.
- Substitution effects in MDA. Correlated factors split and cancel importance; permute correlated groups together, or orthogonalise (PCA) first (AFML §8.3).
- Feature selection before the fold split = leakage. Screening uses the target; doing it once on all data then CV-ing leaks the future. Screen inside each fold on training data only.
- Unpurged hyperparameter search. Overlapping labels leak across folds;
GridSearchCVon standard K-fold double-overfits. Use purged/embargoed CV (Purged CV) and a proper loss (log-loss), not accuracy. - Accuracy is a dishonest metric. It is insensitive to confidence; a model that is right but low-conviction scores the same as one that is confidently right. Use log-loss / proper scoring for tuning.
- Ignoring transaction costs and capacity. A tree edge of a few basis points vanishes after costs; validate net of costs (Backtesting Hygiene).
5. References
- López de Prado, Advances in Financial Machine Learning
- Strobl, Carolin et al., “Bias in Random Forest Variable Importance Measures,” BMC Bioinformatics, 2007
- Hastie, Tibshirani & Friedman, The Elements of Statistical Learning
- Bailey & López de Prado, “The Deflated Sharpe Ratio,” JPM 40(5), 2014