I have already tried rebooting and get letest version. Also creating the new copy to assignment. Nothing seems to be working.
Did you also take a look through these 18 related threads for ideas?
Yes, notice that you also failed the grader for the previous function get_country
. Thereâs a very common error in that function that involves referencing global variables instead of the actual parameters being passed to your function. If you make that mistake in get_country
then get_accuracy
also fails the grader, since it calls get_country
.
Just as a general matter, when you pass the tests in the notebook, but fail the grader, it means that your code is not âgeneralâ. E.g. youâve hard-coded some assumptions like dimensions to match the particular test case in the notebook or youâve referenced a global variable that happens to be passed as an argument in the notebook case, but the grader passes a different input parameter.
Thanks. It is working now.
Glad to see your problem is resolved, but you could leave a legacy for future learners by sharing information about what changed. Did you just restart the kernel and ârun allâ ? Use a different browser? Fix a bug? Any best practice or takeaways others can use? Thanks
Hey Bro I am facing the exact same issue, please share me the changes,
it would mean a lot,
Thanks
Sorry Sir I am not able to apply your hint. Please help me how to make this particular code cell more general.
This is the only assignment I am facing problems Sir, please help me with this.
Thank You
(I am a big fan of you Sir)
It is probably my earlier comment that is the one that is more specific to this problem. Did you read and think about what it says there?
Yes Sir I understood it very well but somehow I am just not able to perform desired changes.
Please suggest me the change.
Thank You
{moderator edit - solution code removed}
Ask yourself why you reference two different variables embeddings
and word_embeddings
in that code? Where is word_embeddings
defined? It is a global variable that happens to be passed as an argument (by reference) to get_country
by the code given in the notebook. So writing the code the way you did is not general: it works in the notebook because that is what happened to get passed as the embeddings
argument. But what if the grader passes a different dictionary for that argument? Kaboom, right?
Thank You Sir,
I knew your help will be worth it.
Thank you for your patience.