In classical statistics, confounding variable is a critical concept since it can distort our view about input variables and outcome variable's relationship. Many forms of control and adjustment are sought in statistics to eliminate, avoid or minimize the effect of confounding. For example, expected confounding variables (i.e., age and sex) are often included in the analysis, in the final model, the coefficient of your interested explanatory variable (i.e., treatment) is then adjusted for confounding (i.e., age and sex).
Confounding is not a frequent topic shows up in machine learning and predictive analysis. I wonder how confounding may (or may not) play an important role in machine learning algorithms. Does confounding potentially affect the accuracy of out-of-sample accuracy? Does including or not including an expected confounding variable play an important consideration when selecting as feature in machine learning?