UNQ_C9 (UNIQUE CELL IDENTIFIER, DO NOT EDIT)
You do not have to input any code in this cell, but it is relevant to grading, so please do not change anything
Test your implementation:
v = np.array([1, 0, 1])
candidates = np.array([[1, 0, 5], [-2, 5, 3], [2, 0, 1], [6, -9, 5], [9, 9, 9]])
print(candidates[nearest_neighbor(v, candidates, 3)])
[[9 9 9] [1 0 5] [2 0 1]]
Expected Output:
[[2 0 1] [1 0 5] [9 9 9]]
My list of KNN is just the reverse of expected output. Not sure what is going wrong here.
Need some help to troubleshoot.