Week 2 Logistic Regression with a Neural Network Mindset

Hi @iyeron, the print_cost parameter doesn’t need to be passed because optimize has a default value for it. So that is not the problem i.e. that is not the parameter that is missing and which is causing your error, could you please compare your call with the definition?

def optimize(w, b, X, Y, num_iterations=100, learning_rate=0.009, print_cost=False)

If you don’t find the error maybe you could share with me (direct message) the way you are calling optimize function inside the model function.

1 Like

Thanks @albertovilla

It worked.


Am a bit stuck on constructing the cost function in exercise 5 propagation, please can someone give osme guidance on what correct arguments are for the np.dot?

I have tried using the arguments y and previously defined A and combining with np.log to replicate the equation givien for the cost function but I either get missing argument or mismatch dimension errors.


My model is asserting on np.allclose in the public test but when executing:
logistic_regression_model = model(train_set_x, train_set_y, test_set_x, test_set_y, num_iterations=2000, learning_rate=0.005, print_cost=True)

I get:
train accuracy: 99.04306220095694 test accuracy: 70.0

Does anyone know what could be wrong?

Never mind I had written …, cost = optimize … instead of …, costs = optimize …