Single variable logistic regression

43 Views Asked by At

I am trying to write out the code for using Newton-Raphson to solve for a coefficient and intercept in a single variable logistic regression.

However in both the math and in the code I see that the Hessian matrix is not invertible. Is Newton-Raphson not applicable to single variable logistic regression or am I just doing something wrong?

If it is not applicable is there anything that converges faster than GD/SGD that I can use? An external library does not fit the use case.