Let's say I have a classification problem, and want to use the randomForest package in R to solve this.
In my training set I want to add a third variable, var3, which is the product of var1 and var2. Thus, the training set would consist of var1, var2, var3 and the class variable.
However, this var3 is not present in the test set, and consequently, randomForest will give an error when I want to test my model:
random forest Error in eval(expr, envir, enclos) : object var3 not found
Is there any way to get around this?