Basic Prerequisites: Statistics & Inference (bias–variance, model selection) and 05 · Bias–Variance & Validation. (these are the folder-level prerequisites for pages 02–06; page 01 states its own, smaller, entry requirements)
1. Intuition & Practical Objective
Decision trees partition the feature space into rectangles and fit a constant inside each rectangle. That single idea is why trees - and their ensembles, random forests and gradient-boosted trees (XGBoost / LightGBM / CatBoost) - are the default workhorse of tabular quantitative ML. A tree makes no linearity assumption, tolerates outliers (the split only cares about order), natively captures interactions (a deeper path is a conjunction of conditions), and needs no feature scaling. On a factor cross-section where “momentum works only above a volatility threshold” or “value pays only when quality is high”, a linear model must be told the interaction; a tree discovers it.
This folder is a hub: it (a) gives you the fast method/derivation lookup below (job #1), and (b) routes you through six sub-pages that build the intuition from zero, derive the split criterion and the boosting recursion, implement a tree / forest / booster from scratch, name the failure modes that matter in low-SNR finance, and hand you the feature-importance toolkit (MDI/MDA/SFI) and the ensembles/monotonicity extensions.
The one-sentence essence. “Grow many weak, axis-parallel, interaction-aware learners - average them to kill variance (bagging/RF), or add them stagewise along the negative gradient of a loss to kill bias (boosting) - and in the low-SNR financial cross-section this tabular family, not deep nets, is what actually wins.”
2. Mathematical Ground Truth & Lookup
All numbers in the check column were re-executed and reproduced exactly from the runnable code in the sub-pages (numpy only).
Notation: training set , ; tree region with leaf count and node sample sizes ; ensemble size (RF) or (boosting); learning rate ; tree .
| Quantity | Formula | Verified check |
|---|---|---|
| Tree prediction (ESL 9.10–9.11) | - | |
| Greedy split (ESL 9.13) | depth-1 split recovers | |
| Within-node SSE (fast form) | - | |
| Gini impurity (ESL 9.17) | binary, | |
| Cost-complexity prune (ESL 9.16) | - | |
| Bagging (ESL 8.51–8.52) | single-tree MSE bagged | |
| RF variance (ESL 15.1) | 8-feature panel: | |
| Boosting stagewise form (ESL 10.28) | 400 depth-2 trees: single | |
| AdaBoost weight (ESL 10.1) | - | |
| XGBoost 2nd-order objective | - | |
| XGBoost optimal leaf weight | - | |
| XGBoost split gain | - | |
| MDI importance (ESL 10.42) | pure-noise feature scores | |
| MDA (permutation) | duplicate twin: vs |
The critical finance caveat. Trees are low-bias, high-variance and will memorize noise if grown deep; the IC ceiling (a legitimate daily cross-sectional model reaches ) means depth, learning rate, and the number of trees are not free parameters - they are the whole ball game. Every failure mode in 05 · Failure Modes reduces to this.
3. Computational Implementation - the shared tree engine
Every page in this folder runs on a compact, dependency-free CART engine (numpy only); this is the exact engine the sub-pages call. It reproduces the split on the synthetic panel.
4. Failure Modes & First-Principles Breakdowns
Hub signposts - the full treatment lives in 05 · Failure Modes & Practice. In one line each:
- Unbounded depth memorizes noise - train MSE keeps falling while test MSE turns up (depth 5 → 8 → 12 gives test MSE ).
- MDI is an in-sample, cardinality-biased ranking - a pure-noise continuous feature scored MDI against for the single informative binary feature.
- MDA under correlated features is a substitution trap - permuting one of two near-duplicates shows almost no drop, so both look irrelevant (AFML Ch 8).
- Feature selection before the fold split is leakage - screening on the whole sample produced a phantom on data whose true is (honest folds gave ).
- Boosting overfits in low SNR - train error falls monotonically while test error plateaus then rises; and must be validated out-of-sample.
5. References
- Hastie, Tibshirani & Friedman: The Elements of Statistical Learning (2nd ed., 2009)
- Chen, Tianqi & Guestrin, Carlos: “XGBoost: A Scalable Tree Boosting System,” KDD, 2016
- Ke, Guolin et al.: “LightGBM: A Highly Efficient Gradient Boosting Decision Tree,” NeurIPS, 2017
- López de Prado, Marcos: Advances in Financial Machine Learning (Wiley, 2018)
- Gu, Shihao; Kelly, Bryan; Xiu, Dacheng: “Empirical Asset Pricing via Machine Learning,” RFS 33(5), 2020
6. Connected Graph Bridges
- Foundational base: Statistics & Inference · 05 · Bias–Variance & Validation
- Sibling topics: Financial ML Pitfalls & Low SNR · Purged CV & Backtest Hygiene · Tree-Based Factor Ranking & Purged CV
- Regression base: Feature Engineering & Target Labeling · Fundamental Multi-Factor Models
- Sub-pages (in-folder): 01 From Zero · 02 Decision Trees · 03 Bagging & Random Forests · 04 Gradient Boosting · 05 Failure Modes & Practice · 06 Advanced Extensions