I'm doing a regression to predict house prices using multiple algorithms and the h2o platform. In particular, I'm using a variety of GBM, DRF, and GLMs.
I have a large amount of data from several sources. Many of my features are categorical, with many categories. I'm finding some have 50+ categories, and when I do value_counts, some of the classes have single-digit sample sizes.
My question is, is there a general rule for grouping such categories into a new feature w.r.t. the maximum number of categories I should have, and a minimum number of observations per category (training+test data at this point) ?.
Some of the categories can be grouped logically with others For example, zoning RF7* or RF7h can be grouped with RF7. Others would have to be grouped in some sort of misc. category.
I know some frameworks have a max number of categories they can handle, with h2o being one of the biggest, but I was wondering if there might be something more empirical to guide me?