Hello,
I have an issue with the week 2 practice lab: Linear regression
In UNQ_C1 I wrote the code to compute the cost function
The cost as initial computed is 75.203 which is correct but when executing compute_cost_test(compute_cost) I have an error, see below :
[Image removed as containing code]
I cannot understand the error since compute_cost_test is a black box, but since my cost function returns the expected value for the cost at initial when input with x_train, y_train, initial_w, initial_b, I would expect it to be correct
I have the same error with # UNQ_C2, the output is as expected for the computation of gradient descent with the input of x_train, y_train, initial_w, initial_b, but compute_gradient_test(compute_gradient) returns an error
Therefore my grade is 0/100 but I cannot understant why
Could you please help me?
In case this is needed please see below what I wrote for UNQ_C1, please moderators remove it if it should not be posted here :
[Image removed as containing code]
Thanks a lot!
EDIT : Below the error I get when submitting :
Code Cell UNQ_C1: Unexpected error (IndexError(‘index 3 is out of bounds for axis 0 with size 3’)) occurred during function check. We expected function compute_cost
to return cost for perfect prediction must be 0. Please check that this function is defined properly.
Code Cell UNQ_C2: Unexpected error (IndexError(‘index 3 is out of bounds for axis 0 with size 3’)) occurred during function check. We expected function compute_gradient
to return compute_gradient failed expected [2., [0]]. Please check that this function is defined properly.
If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps.
This dependency may be the cause of the errors.