Logistic Regression wrong output

https://github.com/anishchandak7/Machine_learning/blob/anishchandak7/Logistic_Regression_Classification.ipynb

I have made changes in error function as error which was described in implementation video giving runtime error of divide by zero encountered with log2

in cell [27]

x = np.linspace(-4,8,10)
y = -(w[0]*x+b)/w[1]
plt.plot(x,y,color=‘k’)
plt.legend()
plt.show()

you are trying to plot y but its w[0],b,w[1] are not defined yet and there are many other errors also

Just download the notebook from the CB repo as it is and try running it

In cell 38 i have defined w and b.
And what are the other errors.
As you said i tried sir’s code and its working fine & i compared it with my code still not getting what is wrong with my code.

snapshot of your repo you have not defined w,b and you are using it

predict function is used in get_acc here but defined down below

https://drive.google.com/open?id=1wn_LEoIiO1aTKk9RxYGIcMgAxH1nRMtT

try this notebook

in get_gradient function your grad_w += update was wrong

Thank you @anmolthegr8est

1 Like