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


1 Answer 1


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

  • $\begingroup$ Why? I'm just starting to learn neural networks, and so far I haven't read about anything that's the equivalent of the intercept in regression. $\endgroup$
    – JenSCDC
    Jun 24, 2014 at 20:40
  • 1
    $\begingroup$ The intercept is often called bias in neural network texts. $\endgroup$
    – bayerj
    Jun 25, 2014 at 10:03
  • $\begingroup$ Obviously I still have a good deal to learn about neural networks. $\endgroup$
    – JenSCDC
    Jun 25, 2014 at 13:33
  • $\begingroup$ I don't think it is only a matter of style. See my answer stats.stackexchange.com/questions/231285/… $\endgroup$ Jul 25, 2019 at 16:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.