C1_W2_ Week2 practice lab - Linear_Regression

I think there is some issue with this notebook. If I solve this exercise and submit it, it shows failed even though I have passed the notebook checker.

The first code for It showed failed when I submitted it.

# mentor edit: code removed

but this code shows passed:

# mentor edit: code removed

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

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

I have edited your post to remove the code.

Passing the tests in the notebook does not prove your code is perfect. The grader uses totally different tests

So the first thing to check is whether your code will work with any size or shape of data set.

The second thing to check is whether the code you added uses any global variables.

After you have checked those issues, please post back a screen capture image that shows any error messages you get in the notebook, or the grader’s detailed feedback.

= = = = = =

Some style tips:
Avoid using “error” as a variable name. It tends to be used as a keyword in many computer languages, so this can confuse the grader.

And, be careful about your indentation. That’s critical to how python creates blocks of code.

I seem to have a similar issue. I have tried to recreate all hints. It shows as passed. still the grading shows that i failed. I also tried in a more short and compact way, but i had the same issues there.
no errors highlighted

@ThomasRoth.
What is the detailed grader feedback? Please post a screen capture image.

@TMosh
Grader feedback:
Code Cell UNQ_C1: Function ‘compute_cost’ is correct.
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 errors.

Thanks BTW for helping. Appreciate it

I’d say there is an error in the code you added to the compute_gradient() function.

Note that passing the tests in the notebook doesn’t prove your code is perfect. The grader uses different tests.

The first thing to check is whether your code in compute_gradient() uses any pre-defined constants or global variables.

thanks. I guess there was one line missing based on an assumption on how python works. i would recommend checking the “more hint” session to see if you would not want to add one particular stub of code to make this very clear. IMHO you would not reveal much more, since you are doing this particular step with other variables in the hint section anyways.