# Random Forests and data transformations

I've started reading about Random Forests and one of the attributes that appeals to me is that they are good at dealing with independent variables that interact with one another. Does Random Forest also "automatically" transform variables into, for example, the square of the variable? Is there a good reason to square or perform other transformations of a variable (of course dependent on the situation)? For example if I have y = x1 + x2 + x3 is there anything to be gained by running the model y = x1 + x1^2 + x2 + x2^2 + x3 + x3^2?

• A little more care in this analysis would be welcome, because squaring is not a one-to-one transformation. Thus a comparison of the square to a threshold is not quite the same thing as a comparison of the original variable to a threshold. This issue can be fixed up, provided the transformation is sufficiently nice, but what about the case of multivariate transformations of variables, such as $x_1x_2$? That's no mere "rescaling." – whuber Dec 15 '15 at 22:44
• I don't agree with this answer. Decision trees are built based on groups variances and if your transformation is not linear, then, in the other scale, the "most heterogeneous" grouping can change. As an example, a feature is uniformly distributed on (0,0.1) for a group and on (0.95,1.05) for the other, now take the non-linear transformation x^200 and there is a high chance those guys between 0.95 and 1.00 will be classified with the first group . – Freguglia Sep 8 '18 at 21:58