I have been working on Week 2 Practice Lab on Supervised Machine Learning: Regression and Classification and code is grading 0% despite everything being correct

These are compute_cost and compute_gradient function, I have spent more than two days on this issue everything is outputting right:

def compute_cost(x,y,w,b):

# mentor edit: code removed

the other Function:

def compute_gradient(x,y,w,b):

# mentor edit: code remove

the error i am getting:

Code Cell UNQ_C1: Function ‘compute_cost’ is incorrect. Check implementation. Code Cell UNQ_C2: Function ‘compute_gradient’ is incorrect. Check implementation. 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 error.

If you want anything else I will be happy to provide.

Please do not share your code on the forum. That is not allowed by the Code of Conduct.

I will edit your message to remove the code.

If a mentor needs to see your code, we’ll contact you with instructions.

Instead, you can share a screen capture image of any error messages.

I cannot share screenshots as i am new here that is why I posted the code. I need this resolved coz i cannot move further without this thing clearing.

How can I share the code or my lab

Hi! Can you let us know what you see when you try to post a screenshot? Does it show any message? Will include it in my report so it can be fixed. Thanks!

Edit: on second thought, i’ll just report it now.

On another note, I see you already included the error messages in the initial post. Have you tried the troubleshooting tips here already? Also check the other FAQs if any of it helps. Let us know how it goes. Thanks.

code posted on public thread has been removed

Hi @arvindarya ,

Please check your mail box for a message from me.

Hi @arvindarya ,

Each graded code cell has special marker for the grader for testing your code, however, none of these special markers can be seen on your assignment. Below is an example:

#UNQ_C1

Also, the unit test helps to check your code, but that is not the full test. The grader has a different set of tests and criteria to check your code.

As you file is now corrupted, I suggested you take a fresh copy of the assignment and redo you code.

  1. renamed your current assignment file to something different

  2. click on the help button on the top right with a ? symbol, a side window will open and follow the instruction for getting latest version

I have done it all I have included the #UNQ_C1 and all it doesn’t work, see I think you mean well but it has been 3 days and I am stuck here the other assignment does not work either. Please look into it. I just want to learn. I do not want submitting code again and again to get a 0% my lifestyle.

Please seriously look into it.

Or screw the certificate just let me watch the videos. They are not on YouTube. This is the most abysmal experience I have ever had working with a course.

Thank you so much,

Arvind

(staff edit: solution notebook removed)

Hi @arvindarya ,

I have taken a fresh copy of the assignment, and copied UNQ_C1 and UNQ_C2 of your code to my copy of the assignment. Passing unit tests with results matching the expected output and successfully submitted to the grader with 100%.

So there is no problem with the grader grading your assignment, it must be something else. I suggest you do a clean run, save it before submit your assignment. It could be the autosaved is not activated, hence any changes you made have not been saved when you submit your assignment for grading.

Please follow these steps from the menu bar at the top of your notebook:

  1. kernel → restart & clear all output

  2. cell → run all

  3. file → save and check point

  4. submit assignment

I want to get to the bottom of this, so do let us know how you get on.

1 Like

Hi Arvind. I’m seconding Kin’s findings. As mentioned earlier, please refer to the troubleshooting tips here to make sure your notebook is formatted correctly for the grader. That also has a link on how to get a fresh copy of the lab. The notebook you uploaded is invalid because of the filename and removal of other boilerplate code (I have to take this down as per forum policies). Once you get a new notebook with the correct filename, you can simply paste your solution in the right places, make sure everything runs, then submit. Hopefully you also get 100 as Kin and I did (using your solution in the two required exercises). Hope this helps.

Only modify the notebook where the instructions tell you to (via the “START CODE HERE” and “END CODE HERE” banners).

Do not rename the notebook, or add or delete any cells.

Making any other changes will confuse the grader.

Man I copied the code as it is from coursera as it, AS IT IS, still won’t take, I don’t know what to do have done everything. You guys cannot build a better grader or is there something wrong coz I don’t see it.

Can you sincerely look into it, that would be great try to run it on your side.

{mentor edit: code removed}

Hi Kic,

I have similar issues with week 2 assignment. I followed your instructions to restart & clear all output, and their subsequent steps. I still run into the same issue of receiving 0% grade after submission, despite not seeing any error code and receiving the correct output result on the notebook.

Upon checking the “My Submission Tab,” it says the error is “Comment line with index: `UNQ_C1` wasn’t found in code. ”

Would you please advise a resolution?

Please do not share your code on the forum. That’s not allowed by the Code of Conduct.

If a mentor needs to see your code, we’ll contact you with instructions.

Why does your notebook have the incorrect file name?