# How to encode categorical variables for neural networks [duplicate]

In regression, you encode a categorical variable with n possible values using n-1 indicator variables. How about for neural networks?

You do the same. Although people use $n$ instead of $n-1$ more often, which is probably just a matter of style.