I'm trying out logistic regression. While running the code, i get math domain error in python. Found out that i'm inputting (mx+b > 38) values large than 38 into the sigmoid function and it outputs 1, and the log function (-log(1-1)) spits out "math domain error".
Here are my steps:
- Find mx+b
- input mx+b as x in the sigmoid function
- Input the value from sigmoid, y-value, x-value to the cost function
- Find gradient from the above values.
- Optimize the weights using gradient value.
Please help.