42-AI / bootcamp_machine-learning

Bootcamp to learn basics in Machine Learning
Other
205 stars 41 forks source link

Module02ex06 - Wrong parameters for mse_ call in subject #205

Closed arlaine4 closed 2 years ago

arlaine4 commented 2 years ago

Issue in example for mse call parameters and result_ :

myLR_age = MyLR(theta = [[1000.0], [-1.0]], alpha = 2.5e-5, max_iter = 100000)
myLR_age.fit_(X[:,0].reshape(-1,1), Y)
myLR_age.mse_(X[:,0].reshape(-1,1),Y)
#Output
57636.77729...

What I did to make it work

myLR_age = MyLR(theta = [[1000.0], [-1.0]], alpha = 2.5e-5, max_iter = 100000)
myLR_age.fit_(X[:,0].reshape(-1,1), Y)
y_hat = myLR_age.predict_(X)
myLR_age.mse_(Y, y_hat)
#Output
57636.77729..

Also , if you set a higher max_iter value, you can (obviously) get a smaller loss value. I think the subject should say that it's okay to have a smaller loss value if you use a significantly higher max_iter value for your model

madvid commented 2 years ago

En cours de fix. Clarté apporté à l'exemple +fix de la valeur de l'exemple car incorrecte.

Also , if you set a higher max_iter value, you can (obviously) get a smaller loss value. I think the subject should say that it's okay to have a smaller loss value if you use a significantly higher max_iter value for your model

Not necessary if one has watched the suggested video recommended at the beginning of the subject.