Grade Received: 0% • To Pass: 80% or higher

When creating a post, please add:

  • Week 2 programming assignment
  • Link to the classroom item you are referring to: [Week 2 practice lab: Linear regression | Coursera]
  • I am getting this while submitting the lab for grades.
    Code Cell UNQ_C1: Function ‘compute_cost’ is incorrect. Check implementation.
    Code Cell UNQ_C2: Function ‘compute_gradient’ is incorrect. Check implementation. I am facing this errors

Hi @Sucharita ,

You’ll need to carefully check the correctness of your compute_cost and compute_gradient implementations by comparing your results with the expected values provided in the lab.

As mentors, we can’t help debug without seeing your code—and please remember that sharing code here isn’t allowed.

Hope it helps! Feel free to ask if you need further assistance.

There errors mean the code you added to compute_cost() and compute_gradient() does not work correctly.

Note that the grader uses totally different tests. Just passing the tests that are built-into the notebook is not sufficient. They do not prove your code is perfect.

Tips:

  • Read the Hint code sections of the notebook (if this assignment provides them).
  • Do not use global variables in the code you add.
  • Do not hard-code any constant values, if there is a variable that has the same information.
1 Like