(This specific question is kinda old now, but the issue is common, and our answers are an enduring resource. So please ignore the untimeliness of this reply.)
It appears from the description and comments that you've created an arbitrary sample of 8,000 observations for the training set, and that's not serving you well.
Obvious things you could do to help with that would be:
- increase the size of the training set,
and/or
- develop a stratified sampling method to split your data into
training vs test, which forces in those predictors (industry
flags) you believe ought to be included.
The quote "this dummy variable generates by several hundred more variables (features) in the test set then the training set" also suggests that your training dataset could be relatively wide relative to its height. In other words, you may have insufficient EPV (events per variable) to have a stable & credible model. Another reason to increase the size of the training data.
Personally, I'm always going start with a training set that is As Big As Possible. I'll only cut it down IF the training process chugs along for an intolerable amount of time. If the initial training set had been half of the available data ... i.e., 200k records rather than 8k ... it's likely that no time would have been wasted trying to understand and solve the "some industries aren't represented in the training data" problem that was created by the choice to use a small sample. Computer time is usually much cheaper than people-time. (That said, I don't deal with Amazon/Google-sized datasets.)