Implementation of Logistic regression without using bias

I was trying to implement logistic regression without using bias as it is shown in the video but i am not able to do it.
here is link to my code https://github.com/shahianshu/Machine-learning-Algorithms/blob/master/Logistic%20Regression/Logistic%20Regression.ipynb 1

i am taking theta instead of w and making 3rd column of data matrix as 1 to represent the bias or theta0 value.
please tell me where i am doing wrong ?

Hello @anshushahi98,

Inside the for loop, you are passing the previously initialized theta again and again, you should pass the updated theta in each iteration.

Like this:

l, theta = grad_asscent(y_train, x_train, theta, learning_rate = 0.1)
loss.append(l)

Happy Learning :slight_smile:
Thanks

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.