The Matrix is inverted but essentially is the asked matrix and im getting wrong that answer. Now i cant even get a grade because all bugged. I cannot even get a new template.
That error means that the grader can’t even check your functions because of some sort of syntax error or other “structural” problem in your notebook. One thing that can cause that is the generated output of running your functions, so the first thing to try is these steps:
Kernel → Restart and Clear Output
Save
Submit
The point is that the grader does not need to see the output of running your notebook: it only needs to call your functions with test cases. In some cases, the generated output can contain text that confuses the grader, so the above process submits the notebook without any of your generated output, just your code.
If that still doesn’t work, then the next thing to try is getting a fresh copy and then carefully “copy/pasting” over just your code from the “YOUR CODE HERE” sections to the clean copy. If you can’t get a fresh copy, that most likely means you did not read the instructions carefully enough: you have to move your existing copy out of the way first. The “refresh” procedure will not overwrite existing files, so start by doing a “Rename” of your existing notebook. Here’s a thread which goes through the process in full detail with explanations.
If even the clean copy doesn’t help, then we’ll go to “Plan B” and need to actually look at your code.
They give you instructions in the comments and in the instructions. The point is that increasing values of cosine similarity indicate decreasing distance. So if we sort by cosine similarity, then the list ends up in the reverse order and gives us farthest first and nearest last. You need to reverse the list before peeling off the requested number of values.
If I make the mistake that you show, then the code does not pass the tests in the notebook for UNQ_C9. Did you fix that problem?