Grader error? Different from Expected output, still passed

Hi moderator,

I found a possible error in the grade. I got a different one from Expected output but stil passed the unittest.

Cossy

Hey @Cossy,
Intriguing! Actually, what you have found is not an error in the grader, but in the hidden test cases. Once your assignment is completed, try submitting this notebook with the erroneous code, and see if you get a complete score. If yes, then please do let us know, so that I can report this as a grader error.

If not, then we can relax about the grader working perfectly fine. Now, coming to the hidden test-cases, the fact is that they are non-exhaustive, since it is practically impossible to account for the possible errors that learners could make. That’s why we have the public test-cases as well, to both, augment the hidden test-cases, as well as to inform the learners about some initial errors.

I think, you would have understood the point by now. Once again, if you get a complete score with this, do let us know. And if not, then you know where to look for the error.

Cheers,
Elemento

Hi @Elemento,

Thanks for your comment! Actually, I passed on this specific question but I’m facing another curious conflict in another question.

Why do you think this is happening?

Cossy

Hey @Cossy,
As I mentioned above, the test cases in the notebook, both public + hidden, form a non-exhaustive set of test-cases. Even after passing all the test-cases, your implementation may be wrong, so, as indicated in the results, please check your implementation for the approximate_knn function. Try to see if you can figure out the error by yourself.

Cheers,
Elemento

Hi @Elemento,

Yes, I tried to look for the mistake in my code but I got no clue where to look for it from this vague error statement.

There was a problem grading your submission. Check stderr for more details.

I can’t even tell if I should check approximate_knn() really, or make_hash_table().
Would you help me out with my code?
Thank you in advance

Cossy

Hey @Cossy,
The grader has scored your implementation of the make_hash_table a 10, but the one of approximate_knn a 0. That means the error lies in the latter one. If you are unable to find the error by yourself, feel free to DM me the code for the same, and I will try to help you out.

Cheers,
Elemento

Hi @Elemento,

I DMed you! Thanks!

Cossy

Hey @Cossy,
A learner pointed out the exact code that is causing this issue. Unfortunately, I can’t find that thread any more. The issue actually lies in the function hash_value_of_vector. More specifically, in this line of code h = sign_of_dot_product > 0. When you use the aforementioned line of code, the output is different from the expected one, and when you use the following code h = sign_of_dot_product >= 0, the output is same as the expected output.

It has been mentioned in the comments # if the sign is 0, i.e. the vector is in the plane, consider the sign to be positive, but I supposed they haven’t implemented any test-case to check this.

Let me tag @Mubsi and @reinoudbosch here, so that they can take it forward accordingly.

Thanks a lot @Cossy for helping us finding this issue.

Cheers,
Elemento

1 Like