Random Forest Regression. How to represent really long list of categories for processing
If the problem is that you don't know all the categories in advance and different records have different categories, then the hashing trick might help.