Simple hack to sklearn's random forest module to implement the Rotation Forest algorithm from Rodriguez et al. 2006.
for tree in trees:
Create a rotation matrix of size n X n where n is the total number of features. Arrange the principal component in the matrix such that the components match the position of the feature in the original training dataset.
Project the training dataset on the rotation matrix.
Build a decision tree with the projected dataset
Store the tree and the rotation matrix.