4

I am trying to implement logistic regression in some problem, but while using normal data gives me some nan results. When I normalize the data I get correct results, so why does Logistic Regression need normalize data?

Thanks.

StubbornAtom
  • 17,932
  • 4
    Overflow can be a problem when doing logistic regression with unnormalized data. For example, logistic regression for binary classification makes use of the sigmoid function $\sigma(u) = \frac{e^u}{1 + e^u}$. If $u$ is some number like $1000$ then computing $e^u$ results in an overflow. We could solve that problem by rewriting $\sigma(u)$ equivalently as $\sigma(u) = \frac{1}{1 + e^{-u}}$. I wonder if this would help in your case. – littleO Mar 23 '20 at 06:05

0 Answers0