Problem Regarding Logistic Regression Code from Scratch

I wrote the code but not getting where it goes wrong , can anyone please help.
When I take heavy weights and biases my algorithm prematurely converges and does not fit the data , I cannot understand the loopwholse in my code , please anyone help me to get through it.

HI @smallboy

I think that because your data is small and learning rate is big so the gradient descent couldn’t converge as possible as so try to pick small number also may you want to doing a normalization to your data to make you computations easier and faster …also if your code isn’t belongs to the assignment of MLS specialization you can share apart of your code which you confused about it

Thanks!
Abdelrahman

Hi @AbdElRhaman_Fakhry
Can you specify what is the meaning of normalization ?

i getting same problem can i modify a code or try another

Hi @smallboy

Normalization(standardization) in machine learning is the process of translating data into the range [0, 1] (or any other range) to make your data(columns) with the same scaler or simply transforming data onto the unit sphere like this image
image
or you can use scikit learn library or any other libraries that doing close same thing like this link 6.3. Preprocessing data — scikit-learn 1.2.0 documentation

Thanks!
Abdelrahman

Hi @prasad_desale

you can do like what I said before [I think that because your data is small and learning rate is big so the gradient descent couldn’t converge as possible as so try to pick small number also may you want to doing a normalization to your data to make you computations easier and faster …also if your code isn’t belongs to the assignment of MLS specialization you can share apart of your code which you confused about it] and my note try to make your code generalize for example try to make your code in function or class to make it easy to do any update in it and if there are any problem please feel free to ask any questions

Thanks!
Abdelrahman