Skip to content
  • Overview
  • Curriculum
    • FLUMental maths and numerical fluency
    • COMBCounting and combinatorics
    • PROBProbability
    • STATStatistics and inference
    • REGRegression and econometrics
    • TSTime series
    • LALinear algebra
    • SCStochastic calculus
    • MLMachine learning
      • 1Framework

        • The framework: bias, variance, capacity and dimensionality
      • 2Tree-based methods

        • Trees: bagging, random forests and gradient boosting
      • 3Other supervised methods

        • Other supervised methods: kNN, SVMs and the kernel trick
      • 4Unsupervised learning

        • Unsupervised learning: clustering assets and correlation structure
      • 5Model selection and evaluation

        • Why k-fold cross-validation is wrong on financial data
      • 6Optimisation for learning

        • Optimisation: gradient descent, momentum and Adam
      • 7Neural networks

        • Neural networks: backpropagation, and when they are the wrong tool
    • SIGAlpha and signal research
    • CASEResearch case studies

Practise

  • Question bank
  • Mental arithmetic
  • Market simulator
  • Arbitrage trees
  • Horse racing
  • Bid book
  • Screening tests
  • Mock papers

Reference

  • Formula reference
  • Search

Your record

  • Review queue
  • Progress
  • Leaderboard
  • Profile
  • Invite friends
AccountSend feedback
  1. Curriculum
  2. /Quantitative research
  3. /Machine learning
  4. /Tree-based methods

Trees: bagging, random forests and gradient boosting

ML · Chapter 2·12 min read·Asked at Two Sigma, Citadel, QuantCo, AQR

Assumes The framework: bias, variance, capacity and dimensionality.

After this lesson you should be able to

  • Say what a tree splits on and why a single tree overfits.
  • Distinguish bagging from boosting by which error term they attack.
  • Read a feature importance sceptically.

A decision tree partitions the feature space into boxes and predicts a constant in each. Alone it is high variance and nearly useless; combined by bagging or boosting it becomes the strongest general-purpose method on tabular data, which is most of what quantitative research works with.

Proposition 2.1

How a tree is grown

At each node, search every feature and every threshold for the split that most reduces impurity — variance for regression, Gini or entropy for classification — then recurse. Grown without limit a tree fits the training data exactly, which is why depth, minimum leaf size or pruning is always applied.

Holds when

  • Splits are axis-aligned, so a diagonal boundary needs a staircase of them.
  • Trees are invariant to monotone transformations of a feature, so scaling and log transforms change nothing.
  • Interactions come free: a split below another split is a conditional effect.
AspectBagging / random forestGradient boosting
AttacksVarianceBias
Base learnersDeep trees, fitted independentlyShallow trees, fitted sequentially
Each tree seesA bootstrap sample and a feature subsetThe residuals of everything so far
ParallelisableYesNo — inherently sequential
Overfits byBarely, with more treesReadily, with too many rounds
Main knobsNumber of trees, features per splitLearning rate, depth, number of rounds
Table 2.2 · Bagging against boosting. The overfitting row is the practical difference. Adding trees to a forest is safe; adding rounds to a boosted model is not, which is why early stopping on a validation set is mandatory there.
15010000.51Correlated at ρ = 0.3IndependentTrees averagedVariance of the average
Figure 2.3 · Why a forest stops improving. Averaging BBB trees leaves ρσ2+(1−ρ)σ2/B\rho\sigma^2 + (1-\rho)\sigma^2/Bρσ2+(1−ρ)σ2/B. The second term vanishes and the first does not, so the floor is the correlation between the trees — which is exactly why a random forest samples features at each split, and why the hundredth tree buys almost nothing.

Why averaging decorrelated trees works. Averaging nnn independent estimates cuts the variance by nnn; averaging nnn perfectly correlated ones cuts it by nothing. Bagged trees fitted on bootstrap samples are already somewhat decorrelated, but they still tend to split on the same dominant feature first. Random forests add a second randomisation — considering only a subset of features at each split — precisely to force the trees apart. The entire innovation is decorrelation, and it is the same n\sqrt{n}n​ diversification argument as a portfolio.

The rest of this lesson is in Premium

You have read the opening. 11 more sections follow, including 4 worked examples and 3 quick checks.

Start the free 7-day trialSign in

Nothing is charged for 7 days, and you can cancel before then. Or read The law of large numbers and the central limit theorem in full, free.

← The framework: bias, variance, capacity and dimensionalityOther supervised methods: kNN, SVMs and the kernel trick →
On this page
  • How a tree is grown
  • Bagging against boosting
  • Why a forest stops improving

QuantMax · 141 lessons · 1342 questions · c5c0caa

  • Premium
  • Arbitrage trees
  • Horse racing
  • Invite friends
  • Account
  • About QuantMax
  • Terms
  • Privacy

Firm names identify publicly reported question patterns and nothing more. QuantMax is not affiliated with, endorsed by, or recruiting for any firm named in the curriculum. Everything you do in lessons and the question bank is kept to your account.