I am currently enrolled in the Coursera Machine Learning Specialization by Andrew Ng. In the course titled “Supervised Machine Learning: Regression and Classification”, I’ve encountered an issue with the final lab assignment of Week 3, specifically in Exercise 4 of the C1_W3_Logistic_Regression notebook.
In the section where I am instructed to compute the training set accuracy, the code cell is locked and cannot be edited. When I attempt to run it as is, it throws an error, preventing me from completing the assignment and resulting in a score of zero.
The error occurs in exercise 4, second part where the task is to compute the accuracy of the training set. The info before the cell says “Now let’s use this to compute the accuracy on the training set”. I am unable to make any changes to this coding cell, and when I run it in its natural state it gives an error. This is leading to me getting a 0 in the assignment. "
When a locked cell gives an error, it almost always means that the cell is calling a graded function that you have updated, and that code does not work correctly.
The locked cells don’t have errors - they’re used for testing your code (or as gent.spah noted, they’re used for setting up the workspace).
The grader input for me getting a 0 is states as follows: “Comment line with index: UNQ_C4 is duplicated”
From what I could deduced it is because of the code cell which is shown in the images I uploaded. The two images show cells from exercise 4 on the assignment. I am able to make edits to one of the cell (The 2nd picture) but for the cell in the first picture I cant make any changes even though the cell has a section where code needs to be filled for it to run.
Also the reason I mentioned the graders give me, as its clear that the Comment line with index: UNQ_C4is present in both cells, and one of these cells doesnt allow me to make any changes. I would like to emphasize that both cells have a section where I need to enter code for the cell to run properly
You appear to have made several incorrect modifications to your notebook, and now it is broken.
I recommend you delete your notebook and get a new copy and start over.
Use the File → Open menu, select the notebook file, and the click on red Trash Can icon.
Then use the Lab Help menu (the question mark inside a circle, on the right side of your browser), and then use “Get latest version”.
Then you’ll need to use the File->Open menu, and open the new copy of the notebook.
This time, do not make any unnecessary changes to the notebook.
For example:
Yeah that appears to be the case, I had taken the course a year or so ago and hadnt done this assignment. Had done a part of it. Took the course again to finish it and started where I left off. Your suggestion worked and doing it from scratch helped me finish it. Thanks to both u and @gent.spah .