C1_W4_Assignment starter

I accidentally changed the code in C1_W4_Assignment. How do I get a copy of the original code?

Here’s a thread which shows how. It is from DLS, but the notebooks work the same way in all the courses in this respect.

Thank you! As for the make_hash_table function, I don’t know what I’m doing wrong.

{moderator edit - solution code removed}

Your code looks reasonable to me. What is the indication of failure that you are seeing? Note that it depends on the previous function hash_value_of_vector being correct. Do your earlier functions also pass their test cases?

Also please note that we aren’t supposed to share solution code in a public way. If the mentors can’t figure out how to help without seeing the code, there are private ways to do that. I’ll edit the post to hide the code. I’m not really a mentor for NLP, so we may need to recruit a real NLP mentor here.

Oh OK. The hash_value_of_vector function passed all test cases.

That’s good news. But you didn’t answer what the error is that you are seeing.

I get 1351 vectors under hash key 0. For the input values in the code I get keys in the ranges 10 ~ 20. Hash_value_of_vector is definitely returning wrong hash values.

But I thought it passed the tests …

Of course a correct function can return bad values if you pass it bad arguments.