NLP Course 1 W4 Ex 11

There are two problems:

  1. The test code has print(f"document contents: {all_tweets[neighbor_id]}") which gives an error. I did not modify this code – it was preloaded.

  2. In approximate_knn, I have been as careful as can be, but outputs are way off. Any insights will be a huge help. I am stuck for the last 3 days on this and Ex 10 (posted already).

Wrong chosen neighbor ids.
Expected: [51, 2478, 105].
Got: [51.0, 701.0, 2140.0].

To clarify, are you talking about EX 21 and not 11?

I haven’t looked at this code in a long time, but the fact the Expected set of index ids shows as integer while the other is floating point seems like a clue. Why would an array index be a floating point number?

Exercise 11 is the same as UNQ_C21. My lab ID is lujzuyfi in case you want to take a look.