# Random forest feature construction: use two separate features or the ratio?

I am constructing a random forest model to predict a dependent variable Y. Two features are X_1 and X_2. However, from domain knowledge, I suspect that X_1 and X_2 don't strongly predict Y on their own, and the feature that really matters is the ratio X_1/X_2. (There are many other features X_i as well.)

For example, suppose that Y is the fraction of people in a given city that drive to work, while X_1 represents the number of cars in the city and X_2 represents the total population of the city. Clearly X_1 and X_2 would independently have at best a weak relationship with Y, while the ratio X_1/X_2 would strongly predict Y.

Can I expect a random forest model to automatically detect that Y scales primarily with X_1/X_2 rather than with either variable independently? Or is it important to use domain knowledge to explicitly create the more relevant feature X_3 = X_1/X_2 before training?

(Maybe another way to say it is that the features X_1 and X_2 are highly correlated, while neither feature is highly correlated with X_1/X_2. I am not a statistical sophisticate.)

I am interested in the answer for both random forest regressors (as in this setup) and classifiers, if they differ.

• Just remember that each split happens on single variable. So by providing the relationship between them, you may decrease noise and increase accuracy with a smaller tree. – Fernando Mar 2 '17 at 18:48
• Sounds like an answer? – abeboparebop Mar 3 '17 at 9:20