C1_W3 graded assignment

  1. I have deleted the UNQ_C4 by mistake. Can someone please share that?
  2. I am getting one error while running regarding the index, I am not sure, where is the issue; also the code is uneditable.

Instructions for restoring your notebook can be found in the FAQ here:

If you see an error message, please post a screen capture image that shows the error and any asserts.

Do not post a copy of your code. That’s not allowed by the community standards. Posting your error messages is fine.

Please find the error below
4 initial_w = np.zeros(n)
5 initial_b = 0.
----> 6 cost = compute_cost(X_train, y_train, initial_w, initial_b)
7 print(‘Cost at initial w (zeros): {:.3f}’.format(cost))

in compute_cost(X, y, w, b)
17 z_i = np.dot(X[i],w) + b
18 f_wb_i = sigmoid(z_i)
—> 19 cost += -y[i]*np.log(f_wb_i) - (1-y[i])*np.log(1-f_wb_i)
21 cost = cost / m

IndexError: index 2 is out of bounds for axis 0 with size 2

I have deleted the basic code(provided by the course) by mistake. Can someone please share the basic code template?



If you are still in that notebook, on the menu bar, click “Edit” > “Undo delete cell”.

Or you can get a new copy by following these steps, which will ask you to rename your current notebook so that the system can get you a new copy. Then you can copy your work from the current notebook to the new one.

Good luck!

The undo button is not working

It won’t work after you close the notebook once, or if there is something wrong. Then please try to get a new copy.

Got it. Thank you Raymond!

Do you still have the “IndexError” problem?

yes. I am still facing the issue.