Week 2: Exercise 8: Variable undefined error

After assigning the predict() values to Y_prediction_test, I get this error while making the return dict

NameError Traceback (most recent call last)
in
1 from public_tests import *
2
----> 3 model_test(model)

~/work/release/W2A2/public_tests.py in model_test(target)
123 y_test = np.array([[0, 1, 0]])
124
→ 125 d = target(X, Y, x_test, y_test, num_iterations=50, learning_rate=0.01)
126
127 assert type(d[‘costs’]) == list, f"Wrong type for d[‘costs’]. {type(d[‘costs’])} != list"

in model(X_train, Y_train, X_test, Y_test, num_iterations, learning_rate, print_cost)
46
47 d = {“costs”: costs,
—> 48 “Y_prediction_test”: Y_prediction_test,
49 “Y_prediction_train” : Y_prediction_train,
50 “w” : w,

NameError: name ‘Y_prediction_test’ is not defined

You have to run all the above cells every time you open the assignment.

Resolved, Thanks