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

Rotation Forest

Rotation forest (Rodríguez, Kuncheva and Alonso, 2006) gives every tree a different rotated view of the features. The features are split at random into groups, PCA is run on a bootstrap sample within each group keeping all components, and the tree is grown on the data rotated into those principal axes. Each tree still sees all the information, but its axis-aligned cuts become oblique in the original space, and the random grouping and subsampling keep trees diverse. This page covers the construction, why rotations help on correlated or slanted structure and hurt on axis-aligned rules, the scale dependence of PCA, and the accuracy-diversity behaviour that makes rotation forests strong with few trees. In the exercises you build rotation matrices and a rotation forest; then you compare it with bagging and random forests on axis-aligned, oblique and re-scaled problems.

Level 0: Foundation

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

Turn the data before you cut it

Decision trees cut along feature axes, which is clumsy when the class boundary runs diagonally. Random forests fight this with averaging. Rotation forest fights it with geometry: before growing each tree, rotate the data onto its principal axes. In those coordinates a slanted boundary may look nearly straight, and one cut does the work of a staircase. Each tree uses a slightly different rotation, from different random feature groups and subsamples, so the trees still disagree usefully.

Rotation forest: rotate first, then cut
bagging (axis-aligned): 92.6%
rotation forest (PCA axes): 94.5%
The data cloud runs diagonally, so its principal axes are diagonal. In those rotated coordinates the slanted class boundary is closer to axis-aligned, and a tree needs fewer, cleaner cuts. Each tree's PCA uses a different bootstrap subsample, so the rotations differ slightly and the trees stay diverse. If the true boundary were axis-aligned, rotating would only get in the way.
Why engineers care

Sensor and spectral features are often strongly correlated: neighbouring wavelengths, redundant accelerometers. Rotation forests exploit that structure and are among the most accurate tree ensembles in large benchmark studies, often with only 10–30 trees. Their cost is extra PCA computation and less interpretable splits.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Rotation forest rotates the features using…
  2. 2. Each rotation tree is trained on…
  3. 3. Rotations help most when the boundary is…

Level 1: Beginner

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

Building a rotation by hand

Setup. p = 4 features, K = 2 groups, chosen at random: x₀ with x₂, and x₁ with x₃.

  1. Group (x₀, x₂). Run PCA on a 75% bootstrap sample. Suppose the principal axes come out as (0.707, 0.707) and (0.707, −0.707).
  2. Group (x₁, x₃). Suppose the axes are (1, 0) and (0, 1): no rotation needed in this group.
  3. Assemble R by placing each group’s 2 × 2 loading block at that group’s rows and columns:
col 0 col 1 col 2 col 3
x₀ 0.707 0 0.707 0
x₁ 0 1 0 0
x₂ 0.707 0 −0.707 0
x₃ 0 0 0 1
  1. Rotate. New features are XR. A point x = (1, 2, 3, 4) maps to (0.707·1 + 0.707·3, 2, 0.707·1 − 0.707·3, 4) = (2.83, 2, −1.41, 4).

Checks.

  • R is orthogonal (RᵀR = I), so distances and total variance are unchanged and no information is lost.
  • Only within-group pairs are mixed, so R is block-diagonal with K blocks (after permuting rows).

The steps in plain English:

  1. For each tree, randomly partition the features into K groups (Rodríguez et al. use groups of about 3 features).
  2. For each group, draw a bootstrap subsample (75% of the data, possibly from a random subset of classes) and compute its principal axes.
  3. Assemble the block rotation R, rotate all the training data, and grow an unpruned tree on XR.
  4. Predict new points by rotating with the same R and averaging the trees’ class probabilities.
📝 Quick check (Level 1)
0/3 answered
  1. 1. Rotated value of (1, 3) by axes (0.707, 0.707)?
  2. 2. RᵀR equals…
  3. 3. Which features get mixed by R?

Level 2: Intermediate

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

Why it works and when it doesn’t

Accuracy and diversity. Kuncheva and Rodríguez (2007) used kappa-error diagrams to show that rotation-forest trees are individually more accurate than random-forest trees, because each sees all the information, while still being diverse, because the rotations differ. This combination makes small ensembles competitive.

Design choices.

  • Keep all principal components. Dropping low-variance components loses discriminative information and was found harmful.
  • Use groups of about 3 features (K = p/3) and a 75% bootstrap subsample per group.
  • The base learner is an unpruned C4.5 or CART tree.

Where rotations help: correlated features, oblique class boundaries, and spectral or sensor data where signal lies along combinations of features.

Where they hurt: axis-aligned rules, where rotation turns one clean cut into many, and categorical or binary features, where PCA rotations are meaningless.

Scale dependence. PCA depends on units. A feature measured in millimetres instead of metres dominates its group’s first component, so that group is barely rotated. Standardising first makes the rotation unit-invariant. Exercise 2 found little effect for a single re-scaled feature, but heavily mixed units can matter.

# Not in scikit-learn; a minimal version:
R = block_diag(*[pca_axes(X_boot[:, g]) for g in groups])[np.ix_(order, order)]
tree.fit(X @ R, y)
🐍 Exercise 1: rotation matrices and a rotation forest
Implement a Gini tree, the block-diagonal PCA rotation matrix (random feature groups, 75% bootstrap per group, all components) and a rotation forest; verify the rotation is orthogonal and variance-preserving, and that a rotation forest beats bagged trees on an oblique boundary.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Rotation forest keeps…
  2. 2. PCA rotations are sensitive to…
  3. 3. Rotation forest trees are typically…

Level 3: Advanced

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

Theory

Oblique cuts via rotation. A split on rotated feature (XR)_j ≤ t is the oblique split r_jᵀx ≤ t in the original space, with r_j the j-th column of R. Rotation forest restricts the directions to principal axes within random groups. That is a cheap, data-adaptive family of oblique splits, in contrast with optimising each oblique split (OC1).

Why groups and subsamples. Rotating all features with one global PCA would give every tree the same rotation, with no diversity. Random grouping and subsampling produce different rotations per tree. Within-group PCA also caps the cost at O(p·g²) per tree for groups of size g, instead of O(p³).

Bias. If the decision rule depends on single raw features (exercise 2, “axis”), any rotation spreads that dependence across several rotated features. Trees then need more splits, and accuracy fell from 0.98 to 0.93. Hybrid ensembles mixing rotated and unrotated trees, or giving the rotation a probability, mitigate this.

Interview questions.

  • When would you try a rotation forest? Correlated continuous features, oblique structure, a small ensemble budget, and features standardised.
  • Why not just use PCA once and then a random forest? A single rotation gives every tree the same view (less diversity), and the top principal components need not be the discriminative directions.
📝 Quick check (Level 3)
0/3 answered
  1. 1. A split on a rotated feature is, in the original space,…
  2. 2. One global PCA for all trees would…
  3. 3. Rotation hurt in exercise 2 when the rule was…

Level 4: Expert

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

When does rotating help?

History.

  • Rodríguez, Kuncheva and Alonso (2006) introduced rotation forest in TPAMI.
  • Kuncheva and Rodríguez (2007) analysed its accuracy-diversity behaviour.
  • Large benchmark studies (Fernández-Delgado et al., 2014; Bagnall et al., 2018 for time series) found rotation forests among the top tree ensembles.
  • Variants include random rotations (Blaser and Fryzlewicz, 2016) and “RotF with feature subsampling” for speed.

Exercise 1.

  • The rotation matrix was orthogonal and block-diagonal (18 non-zeros for two 3 × 3 groups), and it kept all variance.
  • On an oblique boundary over 4 features, a rotation forest of 10 trees scored 0.934 against 0.872 for 10 bagged trees.

Exercise 2. Setup: 8 features, 10 trees, n = 300, 3 repetitions. The table shows test accuracy.

Problem bagging random forest rotation forest rotation forest (standardised)
axis-aligned rules 0.981 0.977 0.933 0.926
oblique (sum of 4 features) 0.877 0.863 0.891 0.889
oblique, x₀ measured ×100 0.877 0.863 0.886 0.889
  • Rotation helped on the oblique problem (+1.4 points over bagging, +2.8 over the random forest), but less than in exercise 1. Here the 4 relevant features are spread across 3 groups, and rotations mix features only within a group.
  • On axis-aligned rules, rotation cost almost 5 points. It smears clean single-feature cuts across rotated features.
  • Re-scaling x₀ by 100 changed little in this case. It kept x₀ unrotated within its group, and standardising recovered 0.003. Mixed units in many features can matter more.
🐍 Exercise 2 (research): when rotations help
On axis-aligned, oblique and re-scaled oblique problems (8 features), compare bagging, a random forest, and rotation forests on raw and standardised features (10 trees, 3 repetitions).

Rotation forests in AI, robotics and aerospace

  • Spectral and hyperspectral classification with strongly correlated bands.
  • Time-series classification: rotation forest is a key component of HIVE-COTE, a state-of-the-art ensemble.
  • Vibration diagnostics from correlated accelerometer features.
  • Small ensembles for embedded deployment, where 10–20 accurate trees beat hundreds of weaker ones.

References

  1. J. J. Rodríguez, L. I. Kuncheva, C. J. Alonso (2006). “Rotation forest: a new classifier ensemble method.” IEEE TPAMI 28(10).
  2. L. I. Kuncheva, J. J. Rodríguez (2007). “An experimental study on rotation forest ensembles.” Multiple Classifier Systems, LNCS 4472.
  3. M. Fernández-Delgado, E. Cernadas, S. Barro, D. Amorim (2014). “Do we need hundreds of classifiers to solve real world classification problems?” JMLR 15.
  4. R. Blaser, P. Fryzlewicz (2016). “Random rotation ensembles.” JMLR 17.
  5. A. Bagnall et al. (2018). “Is rotation forest the best classifier for problems with continuous features?” arXiv:1809.06705.