Foundations to Frontier
Tests
D. Classical Machine Learning › D7 Ensemble Methods

Extremely Randomized Trees (Extra Trees)

Extra Trees (Geurts, Ernst and Wehenkel, 2006) push the randomisation of random forests one step further. At each node they draw K candidate features and, for each, a single random threshold between the node's minimum and maximum, then keep the best of these random splits; each tree uses the whole training set rather than a bootstrap sample. Training is far cheaper, because there is no threshold search, and averaging many randomly placed steps gives much smoother ensemble functions, at the cost of individually weaker trees. This page covers the algorithm, its bias-variance mechanics, the role of K, and when random thresholds beat optimised ones. In the exercises you implement Extra Trees and measure their smoothness; then you compare them with bagging and random forests on smooth and step-shaped targets with irrelevant features.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Don’t search, just guess, many times

A random forest still searches for the best threshold for each candidate feature. Extra Trees skip the search: for each candidate feature they pick a threshold at random and keep whichever random split works best. Each tree is a bit sloppier, but trees become very different from each other, training is much faster, and the average of many sloppy staircases is a smooth curve.

Extra Trees: random thresholds, smoother averages
MSE against the true curve 0.0506 · roughness of the average (×10⁴) 18.12
Each Extra Tree is individually worse (its steps are in arbitrary places), but because every tree puts its steps somewhere else, averaging them makes an almost smooth curve. Bagged CART trees put their steps near the same "best" places, so their average stays step-shaped. With sharp jumps in the target the opposite holds: exact cuts win.
Why engineers care

Extra Trees often match random forests in accuracy while training several times faster. Their smooth ensemble functions suit regression on physical quantities, which tend to vary smoothly. They are a strong, low-maintenance baseline for sensor and telemetry regression, and the randomisation is also used in isolation forests for anomaly detection.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Extra Trees choose split thresholds…
  2. 2. By default each Extra Tree is trained on…
  3. 3. In the demo, Extra Trees' average is…

Level 1: Beginner

★★☆☆☆ Basic⏱ 25 minSecondary-school mathematics: arithmetic and elementary algebra.

A random split by hand

A node holds x = 1, 2, 3, 4, 5, 6 with y = 1.0, 1.2, 0.8, 5.0, 5.2, 4.8. The best possible cut is x ≤ 3.5, with SSE decrease 24.

Extra-Trees split (K = 1). Draw a threshold uniformly in [1, 6].

  • It lands between 3 and 4 with probability 1/5, giving decrease 24 (the best partition).
  • If it lands in (2, 3), the partition is 1, 2 | 3, 4, 5, 6. The decrease is S_L²/n_L + S_R²/n_R − S²/n with S_L = 2.2 and S_R = 15.8: 2.2²/2 + 15.8²/4 − 18²/6 = 2.42 + 62.41 − 54 = 10.83.

With K candidate features, the best of K such random splits is kept. Larger K means more selective splits.

Cost per node. Best-split search scores K·(n − 1) thresholds, after sorting. Extra Trees score K thresholds. For n = 200 and K = 3 that is 3 against 597 evaluations.

The steps in plain English:

  1. For each tree, use all the training data (no bootstrap).
  2. At each node, draw K features at random. For each, draw one threshold uniformly between its smallest and largest value in the node.
  3. Keep the candidate with the best impurity decrease, and stop at a minimum leaf size (2 for classification, 5 for regression in the original paper).
  4. Average (or vote over) many trees. Tune K and the minimum leaf size.
📝 Quick check (Level 1)
0/3 answered
  1. 1. Probability a uniform threshold in [1, 6] lands between 3 and 4?
  2. 2. Thresholds scored per node by Extra Trees with K = 3?
  3. 3. Larger K makes Extra-Trees splits…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 35 minUndergraduate students and practising engineers.

Mechanics and tuning

Algorithm (Geurts et al., 2006). Parameters are K (candidate features per node), n_min (minimum node size to split) and M (number of trees). Defaults: K = √p for classification and K = p for regression.

Why no bootstrap? The random thresholds already supply plenty of diversity. Using all the data lowers bias, because each tree sees every point. Bootstrapping can be switched on, but it usually helps only slightly.

Bias and variance.

  • Random thresholds raise each tree’s bias and variance.
  • They lower the correlation between trees much more, so the ensemble variance falls.
  • In the limit of totally randomised trees (K = 1, any threshold), the ensemble behaves like a kernel smoother with an adaptive kernel (Geurts et al.).

Smoothness. A single tree is piecewise constant. Averaging trees whose cut points are spread continuously yields a nearly continuous function, which suits smooth targets. For targets with true discontinuities, optimised thresholds locate the jumps more precisely.

Irrelevant features. With small K, many splits use noise features with a random threshold and so make little progress. Geurts et al. recommend K = p for regression for this reason. Exercise 2 confirms K = 10 far better than K = 3 when half the features are noise.

Bagging Random forest Extra Trees
Data per tree bootstrap bootstrap all
Features per split all m_try random K random
Threshold best best random (one per feature)
Split cost high medium low
from sklearn.ensemble import ExtraTreesRegressor
et = ExtraTreesRegressor(n_estimators=300, max_features=1.0, min_samples_leaf=2).fit(X, y)   # K = p
🐍 Exercise 1: Extra Trees and smooth ensembles
Implement an Extra Tree (K random features, one uniform threshold each, best of K, no bootstrap), a CART-style tree on a bootstrap sample for comparison, ensemble prediction and a roughness measure; show that on a smooth target Extra Trees are as accurate and give a much smoother ensemble function.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Default K for Extra Trees regression (Geurts et al.)?
  2. 2. Extra Trees reduce ensemble variance mainly by…
  3. 3. Optimised thresholds are better when the target has…

Level 3: Advanced

★★★★☆ Advanced⏱ 30 minGraduate level, with full derivations and proofs.

Theory

Totally randomised trees as kernels. With K = 1 and n_min = 1, the expected Extra-Trees ensemble is a weighted average of training targets, ŷ(x) = Σ w(x, xᵢ)·yᵢ, where w is the probability that x and xᵢ fall in the same leaf. That is a kernel that decreases with distance and adapts to the data distribution (Geurts et al., 2006). Larger K makes the kernel adapt to the target as well.

Smoothness and continuity. Each tree’s cut points are spread continuously, so the expected ensemble prediction is continuous in x even though each tree is a step function. Exercise 1 measured the ensemble’s roughness at about a third of the random forest’s (6.8 against 21.5 ×10⁻⁴).

Computational cost. Without sorting, Extra Trees split in O(K·n_node) per node instead of O(K·n_node log n_node). The total cost is about O(M·K·n log n) for balanced trees, versus O(M·m_try·n log² n) for forests with per-node sorting. Exercise 2 counted about 14× fewer split evaluations than bagging and 4–5× fewer than the random forest.

Interview questions.

  • When would you pick Extra Trees over a random forest? For smooth regression targets, large datasets where training speed matters, or as a fast strong baseline. Use K = p when many features may be irrelevant.
  • Why can Extra Trees underperform? Targets with sharp thresholds, and small K with many irrelevant features (random splits on noise waste depth).
📝 Quick check (Level 3)
0/3 answered
  1. 1. Totally randomised tree ensembles behave like…
  2. 2. The expected Extra-Trees prediction is…
  3. 3. With half the features irrelevant, Extra Trees need…

Level 4: Expert

★★★★★ Expert⏱ 25 minResearchers: original papers and open problems.

Smooth versus step targets

History.

  • Dietterich (2000) randomised the choice among the top-20 splits.
  • Cutler and Zhao (2001) introduced PERT (perfect random tree ensembles).
  • Geurts, Ernst and Wehenkel (2006) defined Extra Trees and analysed their bias-variance behaviour and kernel interpretation.
  • Liu, Ting and Zhou (2008) used totally random splits for anomaly detection (isolation forest).
  • Extra Trees ship in scikit-learn as ExtraTreesClassifier and ExtraTreesRegressor.

Exercise 1. Smooth target, 40 trees each with K = 3:

  • MSE against the true function: Extra Trees 0.0378, bagged best-split trees 0.0409;
  • ensemble roughness (×10⁴): 6.83 against 21.45.

Exercise 2. Setup: 10 features (5 informative, 5 noise), σ = 0.3, n = 250, 15 trees, 2 repetitions. Each cell shows test MSE against the noise-free target, with split evaluations per forest in brackets.

Method smooth target step target
bagging (best split, all features) 0.620 (262k) 0.220 (259k)
random forest (best of 3 features) 0.615 (81k) 0.271 (82k)
Extra Trees, K = 3 0.812 (6k) 0.381 (6k)
Extra Trees, K = 10 0.532 (18k) 0.249 (18k)
  • On the smooth target, Extra Trees with K = 10 were best, about 14% lower MSE than bagging, while scoring 14× fewer thresholds.
  • On the step target, exact thresholds mattered. Bagging won, and Extra Trees (K = 10) came second.
  • K = 3 was worst on both targets. With half the features irrelevant, many random splits fell on noise. This supports Geurts et al.’s K = p default for regression.
🐍 Exercise 2 (research): Extra Trees vs forests on smooth and step targets
On smooth and step-shaped targets with 5 informative and 5 noise features, compare bagging, a random forest, and Extra Trees with K = 3 and K = 10 by test MSE and split evaluations (2 repetitions).

Extra Trees in AI, robotics and aerospace

  • Fast regression baselines for sensor calibration and performance modelling.
  • Reinforcement learning: fitted Q-iteration with Extra Trees (Ernst, Geurts and Wehenkel, 2005), an early batch-RL success.
  • Anomaly detection: isolation forest uses totally random splits to isolate outliers quickly.
  • Large telemetry datasets where training time matters.

References

  1. P. Geurts, D. Ernst, L. Wehenkel (2006). “Extremely randomized trees.” Machine Learning 63(1).
  2. D. Ernst, P. Geurts, L. Wehenkel (2005). “Tree-based batch mode reinforcement learning.” JMLR 6.
  3. T. G. Dietterich (2000). “An experimental comparison of three methods for constructing ensembles of decision trees.” Machine Learning 40.
  4. A. Cutler, G. Zhao (2001). “PERT: perfect random tree ensembles.” Computing Science and Statistics 33.
  5. F. T. Liu, K. M. Ting, Z.-H. Zhou (2008). “Isolation forest.” ICDM.