First it says ‘all test passed’ then when ı submit the assignment it says failed

Even though I get the “all tests passed” output in the Week 3 Unsupervised ML lab test, it still says “failed” when I submit it. I didn’t change the lab file name. what should I do?

Passing the tests in the notebook does not prove your code is perfect. Those tests only check some specific conditions. Those are not the results to grader checks for.

The grader uses entirely different tests, in a different workspace environment.

The grader presumes you did not make any other modifications to the notebook (such as - don’t add cells, don’t delete or move cells, don’t add or change any code outside of the marked areas).

The grader also presumes the code you added does not use any global variables.

What is the detailed feedback from the grader? Please reply with some screen capture images.

1 Like

Hi, I didnot add any extra cells. Here is my feedback:

Your code does not pass some of the grader’s tests for the compute_loss() function.

So that’s where you should start inspecting your code, with an eye toward anything that would only work with the notebook’s built-in tests.

I’ve been trying the compute_loss() function over and over again. I even used the hint section and wrote exactly the same code as there ,which is actually what I had from the beginning, but I still keep getting the same warning.

Please check your personal messages for instructions.

The problem is fixed, thank u so much for your patience and help.

1 Like

To summarize for other learners who may find this thread:

Tips:

  • Do not add extra code to the notebook outside of the areas marked for your code.
  • Be sure your code passes all of the notebook’s test cases before you submit it for grading.