I'm looking for any sort of best practice or ways to go about this situation.
Often I come across datasets that have a categorical variable that I am tempted to split off the main dataset into subsets or to code as a categorical.
For example, I might be trying to look into the price of a car depending upon where it is sold - Asia or Europe. If I am am trying to run a OLS regression, random forest, gbm, lasso, etc - what is the best practice or things that should go through my head here.
If say the Age or MPG of a car is valued differently in Asia vs Europe, will the factor variable account for that in the model to produce results similar to that if I just split into two datasets?
Yes, I realize that splitting by the categorical variable removes the ability to 'see' directly that variables impact, but beyond this I'm looking for guidance. This is a simple example, but I often get approached with a situation like this where I need to determine how to come up with all the various groupings and training datasets and what not.