Week 2 practice lab: Linear regression (assignment)

The grader is broken

Please share a screenshot.

Please share the screenshot of the grader output in image format (not a pdf file).

I am leaving now. Will be back after some 13 or 14 hours. But other mentors will respond to you.

Has your code passed all the test cases?

The grader’s output shows that your code isn’t 100% correct.

1 Like

Hello @Sakshya_Mukherjee .

We are so glad you are interested in our courses and are part of our community! We have amazing mentors in our community that are always willing to help. I am sure they are trying to look at all of the details to see what is the best solution.

As we have mentors from all over the world some might be in a different timezone.

In the meantime, I am linking our FAQ and code of conduct. This can guide you in what makes our community.

And it says a compilation error in cell block 20, I cant even edit cell block 20. This is preposterous

Hi Sakshya. Have you seen the tips here yet? These usually help with code that passes the unit tests but fails the grader. Please check if you’ve cleared all of them so we can troubleshoot further. Thanks.

Hello Sakshya! The screenshot you shared implies that you did not pass all the tests in your notebook. Before submitting your assignment, it is necessary to pass all the tests in the notebook and see the text: \color{forestgreen}{\text{All tests passed.}} Have you seen this green-colored text in your notebook, for every exercise? If not, then your code is incorrect, and blaming grader for that is unfair.

For now, please open your assignment, run every cell from the top, and when you get any error at any point, share that error with us.

Best,
Saif.

1 Like

Hi!
Thank you for your feedback, it really worked

1 Like

Hello, I’m getting an error with some dj_db values, I can’t find the error in the code. Those are the screenshot for the error and the code

{moderator edit: code removed}

First, please do not post 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.

I don’t see any issues with your code.

Next, be sure that you re-run the compute_gradient() cell every time you edit the code there. It isn’t automatic. You have to run the cell before your changes are compiled.

1 Like

Hello Tito,

As told by the other mentor please follow guidelines for code conduct. We are not suppose to share any codes from the grader cells. Also were you able to solve the issue??

@TMosh, this course I had done recently and I had come to know the template codes were updated when I was doing the course as I had the right codes yet was facing similar issue. The updated notebook has a template code which requires us to write codes only in with given code lines at the start of the code. we are not suppose to add any extra line. So I am responding to this post.

@Tito_Puerta you are getting assertion error for dj_db and dj_dw because you are probably recalling first dj_db_i and dj_dw_i and then add it to dj_db and dj_dw. Also check if you have deleted any part of template code given for compute_gradient grader cell especially for dj_db and dj_dw where the initial value is initiated at 0.

If you must have seen your template code for these two were
dj_dw +=
dj_db +=

so you need to write this code in one line, try to put dj_db_i and dj_dw_i variable directly to dj_db and dj_dw as per the below image

Let us know if your issue is resolved. Also kindly from next time create a new post with selection of specialisation, course, weeks’ and assignment name just the way you chose this post here. This way it’s better for everyone to responds and learner to look for similar issue encountered.

Hope it helps!!!

Regards
DP

1 Like

Hi @TMosh, @Deepti_Prasad. Sorry for posting resolution code. Tries your recomendations but still having same error.

@Tito_Puerta, check your private messages for instructions.

Is your issue resolved? if not send your notebook via personal DM.

@Deepti_Prasad, the issue was incorrect indexing inside a for-loop.

Hi, I am getting an error when I execute the fixed cell block after defining compute_cost(). When passing the x_train and y_train values, I get what seems like a datatype error. I have tried re-starting the Kernel, restarting the assignment and troubleshooting, but has not worked so far. Any suggestions ?

The error means your compute_cost() function is returning a cost value that can’t be printed by the statement at line 7.

It may be the wrong data type, or it may be a vector instead of a scalar.