# Categorical variables with too many levels in machine learning [duplicate]

I have a machine learning problem where the dependent variable is binomial (Yes/No) and some of the independent variables are categorical (with more than 100 levels). I'm not sure whether dummy coding these categorical variables and then passing them to the machine learning model is a optimal solution.

Is there a way to deal with this problem?

## marked as duplicate by kjetil b halvorsen, John, Sean Easter, gung - Reinstate Monica♦, Peter Flom - Reinstate Monica♦Apr 24 '17 at 19:39

If we have HUGE amount of data (say 1 billion data points), a categorical variable that has $100$ different levels may not be a problem. Since it is very likely that we have sufficient "training examples" on each level.