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 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.
- 1. Extra Trees choose split thresholds…
- 2. By default each Extra Tree is trained on…
- 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:
- For each tree, use all the training data (no bootstrap).
- At each node, draw K features at random. For each, draw one threshold uniformly between its smallest and largest value in the node.
- 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).
- Average (or vote over) many trees. Tune K and the minimum leaf size.
- 1. Probability a uniform threshold in [1, 6] lands between 3 and 4?
- 2. Thresholds scored per node by Extra Trees with K = 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- 1. Default K for Extra Trees regression (Geurts et al.)?
- 2. Extra Trees reduce ensemble variance mainly by…
- 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).
- 1. Totally randomised tree ensembles behave like…
- 2. The expected Extra-Trees prediction is…
- 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
ExtraTreesClassifierandExtraTreesRegressor.
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.
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
- P. Geurts, D. Ernst, L. Wehenkel (2006). “Extremely randomized trees.” Machine Learning 63(1).
- D. Ernst, P. Geurts, L. Wehenkel (2005). “Tree-based batch mode reinforcement learning.” JMLR 6.
- T. G. Dietterich (2000). “An experimental comparison of three methods for constructing ensembles of decision trees.” Machine Learning 40.
- A. Cutler, G. Zhao (2001). “PERT: perfect random tree ensembles.” Computing Science and Statistics 33.
- F. T. Liu, K. M. Ting, Z.-H. Zhou (2008). “Isolation forest.” ICDM.