Week 2 Practice Lab _ Linear Regression

I am working on the Lab assignment for Week 2
(Machine Learning : Regression & Classification)

On submission of code , receiving the feedback from Grader
Code Cell UNQ_C1: Function ‘compute_cost’ is incorrect. Check implementation.
Code Cell UNQ_C2: Function ‘compute_gradient’ is incorrect. Check implementation.

But when I ran the code , the output is matching with the EXPECTED output
Expected Output below :
w,b found by gradient descent: 1.166362350335582 -3.63029143940436
For population = 35,000, we predict a profit of $4519.77
For population = 70,000, we predict a profit of $45342.45

Can someone guide what is the mistake in assignment submission

1 Like

The grader uses different tests than the ones in the notebook.

Your code must work with any set of data.

Passing the tests in the notebook does not prove your code is perfect.

One common mistake is using global variables inside a function, instead of using the local function parameters.

Please review your code in detail.

“Thank you for pointing that out. I’ll thoroughly review my code to ensure it works with any set of data and adheres to best practices. I’ll also check for potential issues, like the use of global variables instead of local function parameters, and improve it for robustness. Your feedback is greatly appreciated!”

I moved through the first two weeks of Course 1 and then hit a roadblock on :Programming Assignment: Week 2 practice lab: Linear regression." I went back and reviewed previous labs and videos and ultimately seemed to solve all my coding issues. Now when executed all the code cells in my Jupyter notebook seem to work fine and show no error messages. At the end of lab when I submit it the following message is displayed: " Congratulations on completing this practice lab on linear regression! But my grade shows as 0%/100% and the lab on my class calendar displays as incomplete and overdue. Where am I going wrong. Thanks in advance for the help, Richard

Please post a screen capture image showing the grader detailed feedback.

Thank you for the response - I’ve attached the screenshot of the grade screen - the only detail provide is the line:
“UNQ_C1 wasn’t found in code” which suggests I inadvertently deleted some markdown text which was required for the grader to function properly.

That seemed to the do the trick - I replaced the markdown at the beginning of the cell and now the Lab shows as 100% complete.